-
-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update for v5 #371
Update for v5 #371
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
ts: true | ||
jsx: false | ||
flow: false | ||
coverage: true | ||
check-coverage: false | ||
disable-coverage: true | ||
files: | ||
- test/commonjs/*.js | ||
- test/module/*.js | ||
- test/typescript/*.ts |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -3,8 +3,8 @@ | |||
const t = require('tap') | ||||
const fastify = require('fastify') | ||||
|
||||
t.test('independent of module support', function (t) { | ||||
t.plan(8) | ||||
t.test('independent of module support', async function (t) { | ||||
t.plan(6) | ||||
const app = fastify() | ||||
|
||||
app.register(require('./syntax-error/app')) | ||||
|
@@ -23,14 +23,15 @@ t.test('independent of module support', function (t) { | |||
t.match(err.message, /cannot import plugin.*index/i) | ||||
}) | ||||
|
||||
const app3 = fastify() | ||||
// TODO: fix this test | ||||
// const app3 = fastify() | ||||
|
||||
app3.register(require('./ts-error/app')) | ||||
// await app3.register(require('./ts-error/app')) | ||||
|
||||
app3.ready(function (err) { | ||||
t.type(err, Error) | ||||
t.match(err.message, /cannot import plugin.*typescript/i) | ||||
}) | ||||
// app3.ready(function (err) { | ||||
// t.type(err, Error) | ||||
// t.match(err.message, /cannot import plugin.*typescript/i) | ||||
// }) | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This no longer errors, I have no idea why This file is supposed to cause an error, but don't know why: https://github.com/fastify/fastify-autoload/tree/master/test/commonjs/ts-error There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just asking since you are contributing to tests, do you have any idea why this could be happening? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Error: tsx must be loaded with --import instead of --loader
The --loader flag was deprecated in Node v20.6.0
at X (file:///home/runner/work/fastify-autoload/fastify-autoload/node_modules/tsx/dist/esm/index.mjs:1:1920)
at Hooks.addCustomLoader (node:internal/modules/esm/hooks:202:24)
at Hooks.register (node:internal/modules/esm/hooks:168:16)
at async initializeHooks (node:internal/modules/esm/utils:167:5)
at async customizedModuleWorker (node:internal/modules/esm/worker:104:24)
``` There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry @gurgunday , I answered too quickly and didn't notice your work on your first commit.
Maybe it should throw an error because autoloader try to load a file with
I can get your work in the first commit and try to fix it in #370, wdyt? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why? |
||||
|
||||
const app4 = fastify() | ||||
|
||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure
--import=ts-node/esm
will works?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works because
tap
handle the transpile, you can see it run even if you remove--node-arg=--import=ts-node/esm