Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const typescriptTemplate = {
dir: 'app-ts',
main: 'app.ts',
scripts: {
test: 'npm run build:ts && tap "test/**/*.test.ts"',
test: 'npm run build:ts && tsc -p test/tsconfig.test.json && cross-env TS_NODE_FILES=true tap test/**/*.test.ts',
start: 'npm run build:ts && fastify start -l info dist/app.js',
'build:ts': 'tsc',
dev: 'tsc && concurrently -k -p "[{name}]" -n "TypeScript,App" -c "yellow.bold,cyan.bold" "tsc -w" "fastify start --ignore-watch=.ts$ -w -l info -P dist/app.js"'
Expand All @@ -61,6 +61,7 @@ const typescriptTemplate = {
'@types/node': cliPkg.devDependencies['@types/node'],
'@types/tap': cliPkg.devDependencies['@types/tap'],
concurrently: cliPkg.devDependencies.concurrently,
'cross-env': cliPkg.devDependencies['cross-env'],
'fastify-tsconfig': cliPkg.devDependencies['fastify-tsconfig'],
tap: cliPkg.devDependencies.tap,
typescript: cliPkg.devDependencies.typescript
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"@types/node": "^15.0.0",
"@types/tap": "^15.0.0",
"concurrently": "^6.0.0",
"cross-env": "^7.0.3",
"del-cli": "^3.0.1",
"fastify-autoload": "^3.3.1",
"fastify-plugin": "^3.0.0",
Expand Down
4 changes: 2 additions & 2 deletions test/generate-typescript.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function define (t) {
// by default this will be ISC but since we have a MIT licensed pkg file in upper dir, npm will set the license to MIT in this case
// so for local tests we need to accept MIT as well
t.ok(pkg.license === 'ISC' || pkg.license === 'MIT')
t.equal(pkg.scripts.test, 'npm run build:ts && tap "test/**/*.test.ts"')
t.equal(pkg.scripts.test, 'npm run build:ts && tsc -p test/tsconfig.test.json && cross-env TS_NODE_FILES=true tap test/**/*.test.ts')
t.equal(pkg.scripts.start, 'npm run build:ts && fastify start -l info dist/app.js')
t.equal(pkg.scripts['build:ts'], 'tsc')
t.equal(pkg.scripts.dev, 'tsc && concurrently -k -p "[{name}]" -n "TypeScript,App" -c "yellow.bold,cyan.bold" "tsc -w" "fastify start --ignore-watch=.ts$ -w -l info -P dist/app.js"')
Expand All @@ -143,7 +143,7 @@ function define (t) {
t.equal(pkg.devDependencies.tap, cliPkg.devDependencies.tap)
t.equal(pkg.devDependencies.typescript, cliPkg.devDependencies.typescript)

const testGlob = pkg.scripts.test.split(' ')[5].replace(/"/g, '')
const testGlob = pkg.scripts.test.split(' ')[11]

t.equal(minimatch.match(['test/routes/plugins/more/test/here/ok.test.ts'], testGlob).length, 1)
resolve()
Expand Down