fastify-cli
Advanced tools
Comparing version 5.9.0 to 6.0.1
@@ -26,6 +26,6 @@ 'use strict' | ||
'test:typescript': 'tsd', | ||
unit: 'tap "test/**/*.test.js"' | ||
unit: 'node --test' | ||
}, | ||
dependencies: { | ||
'fastify-plugin': cliPkg.devDependencies['fastify-plugin'] | ||
'fastify-plugin': cliPkg.dependencies['fastify-plugin'] | ||
}, | ||
@@ -37,3 +37,2 @@ devDependencies: { | ||
standard: cliPkg.devDependencies.standard, | ||
tap: cliPkg.devDependencies.tap, | ||
'ts-standard': cliPkg.devDependencies['ts-standard'], | ||
@@ -56,3 +55,3 @@ tsd: cliPkg.devDependencies.tsd, | ||
const generifyPromise = promisify(generify) | ||
const file = await generifyPromise( | ||
await generifyPromise( | ||
path.join(__dirname, 'templates', template.dir), | ||
@@ -62,3 +61,2 @@ dir, | ||
) | ||
log('debug', `generated ${file}`) | ||
@@ -65,0 +63,0 @@ process.chdir(dir) |
@@ -20,3 +20,3 @@ 'use strict' | ||
scripts: { | ||
test: 'tap "test/**/*.test.js"', | ||
test: 'node --test test/**/*.test.js', | ||
start: 'fastify start -l info app.js', | ||
@@ -32,5 +32,3 @@ dev: 'fastify start -w -l info -P app.js' | ||
}, | ||
devDependencies: { | ||
tap: cliPkg.devDependencies.tap | ||
}, | ||
devDependencies: {}, | ||
logInstructions: function (pkg) { | ||
@@ -54,3 +52,3 @@ log('debug', 'saved package.json') | ||
scripts: { | ||
test: 'npm run build:ts && tsc -p test/tsconfig.json && tap --ts "test/**/*.test.ts"', | ||
test: 'npm run build:ts && tsc -p test/tsconfig.json && c8 node --test -r ts-node/register test/**/*.ts', | ||
start: 'npm run build:ts && fastify start -l info dist/app.js', | ||
@@ -75,3 +73,2 @@ 'build:ts': 'tsc', | ||
'fastify-tsconfig': cliPkg.devDependencies['fastify-tsconfig'], | ||
tap: cliPkg.devDependencies.tap, | ||
typescript: cliPkg.devDependencies.typescript | ||
@@ -129,4 +126,2 @@ }, | ||
pkg.tap = template.tap | ||
log('debug', 'edited package.json, saving') | ||
@@ -172,14 +167,5 @@ writeFile('package.json', JSON.stringify(pkg, null, 2), (err) => { | ||
template.type = 'module' | ||
template.tap = { | ||
'node-arg': [ | ||
'--no-warnings', | ||
'--experimental-loader', | ||
'ts-node/esm' | ||
], | ||
coverage: false | ||
} | ||
// For coverage, NYC with Typescript ESM doesn't work https://github.com/tapjs/node-tap/issues/735 | ||
template.devDependencies.c8 = cliPkg.devDependencies.c8 | ||
template.scripts.test = 'npm run build:ts && tsc -p test/tsconfig.json && c8 tap --ts "test/**/*.test.ts"' | ||
template.scripts.test = 'npm run build:ts && tsc -p test/tsconfig.json && FASTIFY_AUTOLOAD_TYPESCRIPT=1 node --test --experimental-test-coverage --loader ts-node/esm test/**/*.ts' | ||
} | ||
@@ -192,8 +178,5 @@ } else { | ||
template.type = 'module' | ||
template.tap = { | ||
coverage: false | ||
} | ||
template.devDependencies.c8 = cliPkg.devDependencies.c8 | ||
template.scripts.test = 'c8 tap "test/**/*.test.js"' | ||
template.scripts.test = 'node --test test/**/*.test.js' | ||
} | ||
@@ -200,0 +183,0 @@ |
{ | ||
"name": "fastify-cli", | ||
"version": "5.9.0", | ||
"version": "6.0.1", | ||
"description": "Run a fastify route with one command!", | ||
@@ -13,9 +13,15 @@ "main": "cli.js", | ||
"lint:fix": "standard --fix", | ||
"unit:template-ts-esm": " cross-env TS_NODE_PROJECT=./templates/app-ts-esm/tsconfig.json tap templates/app-ts-esm/test/**/*.test.ts --no-coverage --node-arg=--loader=ts-node/esm --timeout 400 --jobs 1 --color -R specy", | ||
"unit:cli": "tap \"test/**/*.test.{js,ts}\" --no-coverage --timeout 400 --jobs 1 --color -R specy", | ||
"unit:templates-without-ts-esm": "tap \"templates/app/**/*.test.js\" \"templates/app-esm/**/*.test.js\" \"templates/app-ts/**/*.test.ts\" --no-coverage --timeout 400 --jobs 1 --color -R specy", | ||
"pretest": "xcopy /e /k /i . \"..\\node_modules\\fastify-cli\" || rsync -r --exclude=node_modules ./ node_modules/fastify-cli || echo 'this is fine'", | ||
"test-no-coverage": "npm run unit:cli && npm run unit:templates-without-ts-esm && npm run unit:template-ts-esm && npm run test:typescript", | ||
"test": "c8 --clean npm run test-no-coverage", | ||
"test:typescript": "tsd templates/plugin -t ./../../index.d.ts && tsc --project templates/app-ts/tsconfig.json && del-cli templates/app-ts/dist" | ||
"test": "npm run unit:suites && c8 --clean npm run test:cli-and-typescript", | ||
"unit:cjs": "node suite-runner.js \"templates/app/test/**/*.test.js\"", | ||
"unit:esm": "node suite-runner.js \"templates/app-esm/test/**/*.test.js\"", | ||
"unit:ts-cjs": "cross-env TS_NODE_PROJECT=./test/configs/ts-cjs.tsconfig.json node -r ts-node/register suite-runner.js \"templates/app-ts/test/**/*.test.ts\"", | ||
"unit:ts-esm": "cross-env TS_NODE_PROJECT=./test/configs/ts-esm.tsconfig.json FASTIFY_AUTOLOAD_TYPESCRIPT=1 node -r ts-node/register --loader ts-node/esm suite-runner.js \"templates/app-ts-esm/test/**/*.test.ts\"", | ||
"unit:suites": "node should-skip-test-suites.js || npm run all-suites", | ||
"all-suites": "npm run unit:cjs && npm run unit:esm && npm run unit:ts-cjs && npm run unit:ts-esm", | ||
"unit:cli-js": "tap \"test/**/*.test.js\" --no-coverage --timeout 400 --jobs 1 --color -R specy", | ||
"unit:cli-ts": "cross-env TS_NODE_PROJECT=./test/configs/ts-cjs.tsconfig.json tap \"test/**/*.test.ts\" --no-coverage --timeout 400 --jobs 1 --color -R specy", | ||
"unit:cli": "npm run unit:cli-js && npm run unit:cli-ts", | ||
"test:cli-and-typescript": "npm run unit:cli && npm run test:typescript", | ||
"test:typescript": "tsd templates/plugin -t ./../../index.d.ts && tsc --project templates/app-ts/tsconfig.json --noEmit && tsc --project templates/app-ts-esm/tsconfig.json --noEmit" | ||
}, | ||
@@ -77,3 +83,2 @@ "keywords": [ | ||
"cross-env": "^7.0.3", | ||
"del-cli": "^3.0.1", | ||
"fastify-tsconfig": "^2.0.0", | ||
@@ -80,0 +85,0 @@ "minimatch": "^5.1.0", |
@@ -29,3 +29,3 @@ // This file contains code that we reuse | ||
// tear down our app after we are done | ||
t.teardown(app.close.bind(app)) | ||
t.after(() => app.close()) | ||
@@ -32,0 +32,0 @@ return app |
@@ -1,2 +0,3 @@ | ||
import { test } from 'tap' | ||
import { test } from 'node:test' | ||
import * as assert from 'node:assert' | ||
import Fastify from 'fastify' | ||
@@ -10,3 +11,3 @@ import Support from '../../plugins/support.js' | ||
await fastify.ready() | ||
t.equal(fastify.someSupport(), 'hugs') | ||
assert.equal(fastify.someSupport(), 'hugs') | ||
}) | ||
@@ -23,4 +24,4 @@ | ||
// t.error(err) | ||
// t.equal(fastify.someSupport(), 'hugs') | ||
// assert.equal(fastify.someSupport(), 'hugs') | ||
// }) | ||
// }) |
@@ -1,2 +0,3 @@ | ||
import { test } from 'tap' | ||
import { test } from 'node:test' | ||
import * as assert from 'node:assert' | ||
import { build } from '../helper.js' | ||
@@ -10,3 +11,3 @@ | ||
}) | ||
t.equal(res.payload, 'this is an example') | ||
assert.equal(res.payload, 'this is an example') | ||
}) |
@@ -1,2 +0,3 @@ | ||
import { test } from 'tap' | ||
import { test } from 'node:test' | ||
import * as assert from 'node:assert' | ||
import { build } from '../helper.js' | ||
@@ -10,3 +11,3 @@ | ||
}) | ||
t.same(JSON.parse(res.payload), { root: true }) | ||
assert.deepStrictEqual(JSON.parse(res.payload), { root: true }) | ||
}) |
// This file contains code that we reuse between our tests. | ||
import helper from 'fastify-cli/helper.js' | ||
import path from 'path' | ||
import tap from 'tap'; | ||
import * as test from 'node:test' | ||
import * as path from 'path' | ||
import { fileURLToPath } from 'url' | ||
export type TestContext = { | ||
after: typeof test.after | ||
}; | ||
export type Test = typeof tap['Test']['prototype']; | ||
const __filename = fileURLToPath(import.meta.url) | ||
@@ -21,3 +22,3 @@ const __dirname = path.dirname(__filename) | ||
// Automatically build and tear down our instance | ||
async function build (t: Test) { | ||
async function build (t: TestContext) { | ||
// you can set all the options supported by the fastify CLI command | ||
@@ -32,3 +33,3 @@ const argv = [AppPath] | ||
// Tear down our app after we are done | ||
t.teardown(() => void app.close()) | ||
t.after(() => void app.close()) | ||
@@ -35,0 +36,0 @@ return app |
@@ -1,2 +0,3 @@ | ||
import { test } from 'tap' | ||
import { test } from 'node:test' | ||
import * as assert from 'node:assert' | ||
import Fastify from 'fastify' | ||
@@ -10,3 +11,3 @@ import Support from '../../src/plugins/support.js' | ||
t.equal(fastify.someSupport(), 'hugs') | ||
assert.equal(fastify.someSupport(), 'hugs') | ||
}) |
@@ -1,2 +0,3 @@ | ||
import { test } from 'tap' | ||
import { test } from 'node:test' | ||
import * as assert from 'node:assert' | ||
import { build } from '../helper.js' | ||
@@ -11,3 +12,3 @@ | ||
t.equal(res.payload, 'this is an example') | ||
assert.equal(res.payload, 'this is an example') | ||
}) |
@@ -1,2 +0,3 @@ | ||
import { test } from 'tap' | ||
import { test } from 'node:test' | ||
import * as assert from 'node:assert' | ||
import { build } from '../helper.js' | ||
@@ -10,3 +11,3 @@ | ||
}) | ||
t.same(JSON.parse(res.payload), { root: true }) | ||
assert.deepStrictEqual(JSON.parse(res.payload), { root: true }) | ||
}) |
@@ -6,4 +6,4 @@ { | ||
"sourceMap": true, | ||
"moduleResolution": "Node16", | ||
"module": "ES2022", | ||
"moduleResolution": "NodeNext", | ||
"module": "NodeNext", | ||
"target": "ES2022", | ||
@@ -10,0 +10,0 @@ "esModuleInterop": true |
// This file contains code that we reuse between our tests. | ||
const helper = require('fastify-cli/helper.js') | ||
import * as path from 'path' | ||
import * as tap from 'tap'; | ||
import * as test from 'node:test' | ||
export type Test = typeof tap['Test']['prototype']; | ||
export type TestContext = { | ||
after: typeof test.after | ||
}; | ||
@@ -17,3 +19,3 @@ const AppPath = path.join(__dirname, '..', 'src', 'app.ts') | ||
// Automatically build and tear down our instance | ||
async function build (t: Test) { | ||
async function build (t: TestContext) { | ||
// you can set all the options supported by the fastify CLI command | ||
@@ -28,3 +30,3 @@ const argv = [AppPath] | ||
// Tear down our app after we are done | ||
t.teardown(() => void app.close()) | ||
t.after(() => void app.close()) | ||
@@ -31,0 +33,0 @@ return app |
@@ -1,2 +0,4 @@ | ||
import { test } from 'tap' | ||
import { test } from 'node:test' | ||
import * as assert from 'node:assert' | ||
import Fastify from 'fastify' | ||
@@ -10,3 +12,3 @@ import Support from '../../src/plugins/support' | ||
t.equal(fastify.someSupport(), 'hugs') | ||
assert.equal(fastify.someSupport(), 'hugs') | ||
}) |
@@ -1,2 +0,3 @@ | ||
import { test } from 'tap' | ||
import { test } from 'node:test' | ||
import * as assert from 'node:assert' | ||
import { build } from '../helper' | ||
@@ -11,3 +12,3 @@ | ||
t.equal(res.payload, 'this is an example') | ||
assert.equal(res.payload, 'this is an example') | ||
}) |
@@ -1,2 +0,3 @@ | ||
import { test } from 'tap' | ||
import { test } from 'node:test' | ||
import * as assert from 'node:assert' | ||
import { build } from '../helper' | ||
@@ -10,3 +11,3 @@ | ||
}) | ||
t.same(JSON.parse(res.payload), { root: true }) | ||
assert.deepStrictEqual(JSON.parse(res.payload), { root: true }) | ||
}) |
@@ -26,4 +26,4 @@ 'use strict' | ||
// tear down our app after we are done | ||
t.teardown(app.close.bind(app)) | ||
// close the app after we are done | ||
t.after(() => app.close()) | ||
@@ -30,0 +30,0 @@ return app |
'use strict' | ||
const { test } = require('tap') | ||
const { test } = require('node:test') | ||
const assert = require('node:assert') | ||
const Fastify = require('fastify') | ||
@@ -12,3 +14,3 @@ const Support = require('../../plugins/support') | ||
await fastify.ready() | ||
t.equal(fastify.someSupport(), 'hugs') | ||
assert.equal(fastify.someSupport(), 'hugs') | ||
}) | ||
@@ -25,4 +27,4 @@ | ||
// t.error(err) | ||
// t.equal(fastify.someSupport(), 'hugs') | ||
// assert.equal(fastify.someSupport(), 'hugs') | ||
// }) | ||
// }) |
'use strict' | ||
const { test } = require('tap') | ||
const { test } = require('node:test') | ||
const assert = require('node:assert') | ||
const { build } = require('../helper') | ||
@@ -12,3 +13,3 @@ | ||
}) | ||
t.equal(res.payload, 'this is an example') | ||
assert.equal(res.payload, 'this is an example') | ||
}) | ||
@@ -26,4 +27,4 @@ | ||
// t.error(err) | ||
// t.equal(res.payload, 'this is an example') | ||
// assert.equal(res.payload, 'this is an example') | ||
// }) | ||
// }) |
'use strict' | ||
const { test } = require('tap') | ||
const { test } = require('node:test') | ||
const assert = require('node:assert') | ||
const { build } = require('../helper') | ||
@@ -12,3 +13,3 @@ | ||
}) | ||
t.same(JSON.parse(res.payload), { root: true }) | ||
assert.deepStrictEqual(JSON.parse(res.payload), { root: true }) | ||
}) | ||
@@ -26,4 +27,4 @@ | ||
// t.error(err) | ||
// t.same(JSON.parse(res.payload), { root: true }) | ||
// assert.deepStrictEqual(JSON.parse(res.payload), { root: true }) | ||
// }) | ||
// }) |
@@ -8,4 +8,4 @@ import fastify from 'fastify' | ||
app = fastify() | ||
app.ready() | ||
app.register(example) | ||
void app.ready() | ||
void app.register(example) | ||
expectType<() => string>(app.exampleDecorator) | ||
@@ -12,0 +12,0 @@ } catch (err) { |
'use strict' | ||
const { test } = require('tap') | ||
const { test } = require('node:test') | ||
const assert = require('node:assert') | ||
test('should register the correct decorator', async t => { | ||
t.plan(1) | ||
const app = require('fastify')() | ||
@@ -14,3 +13,3 @@ | ||
t.same(app.exampleDecorator(), 'decorated') | ||
assert.equal(app.exampleDecorator(), 'decorated') | ||
}) |
@@ -33,7 +33,4 @@ 'use strict' | ||
javascriptTemplate.type = 'module' | ||
javascriptTemplate.tap = { | ||
coverage: false | ||
} | ||
javascriptTemplate.devDependencies.c8 = cliPkg.devDependencies.c8 | ||
javascriptTemplate.scripts.test = 'c8 tap "test/**/*.test.js"' | ||
javascriptTemplate.scripts.test = 'node --test test/**/*.test.js' | ||
@@ -118,3 +115,3 @@ ;(function (cb) { | ||
test('should finish successfully with ESM javascript template', async (t) => { | ||
t.plan(14 + Object.keys(expected).length) | ||
t.plan(13 + Object.keys(expected).length) | ||
try { | ||
@@ -130,3 +127,3 @@ await generate(workdir, javascriptTemplate) | ||
test('--integrate option will enhance preexisting package.json and overwrite preexisting files', async (t) => { | ||
t.plan(14 + Object.keys(expected).length) | ||
t.plan(13 + Object.keys(expected).length) | ||
try { | ||
@@ -174,3 +171,3 @@ await generate(workdir, javascriptTemplate) | ||
t.ok(pkg.license === 'ISC' || pkg.license === 'MIT') | ||
t.equal(pkg.scripts.test, 'c8 tap "test/**/*.test.js"') | ||
t.equal(pkg.scripts.test, 'node --test test/**/*.test.js') | ||
t.equal(pkg.scripts.start, 'fastify start -l info app.js') | ||
@@ -183,3 +180,2 @@ t.equal(pkg.scripts.dev, 'fastify start -w -l info -P app.js') | ||
t.equal(pkg.dependencies['@fastify/sensible'], cliPkg.devDependencies['@fastify/sensible']) | ||
t.equal(pkg.devDependencies.tap, cliPkg.devDependencies.tap) | ||
// Test for "type:module" | ||
@@ -186,0 +182,0 @@ t.equal(pkg.type, 'module') |
@@ -21,3 +21,2 @@ 'use strict' | ||
const { exec, execSync } = require('node:child_process') | ||
const minimatch = require('minimatch') | ||
const strip = require('strip-ansi') | ||
@@ -105,3 +104,3 @@ const expected = {} | ||
test('should finish succesfully', async (t) => { | ||
t.plan(19 + Object.keys(expected).length) | ||
t.plan(17 + Object.keys(expected).length) | ||
try { | ||
@@ -134,8 +133,7 @@ await generate(workdir, pluginTemplate) | ||
t.equal(pkg.scripts['test:typescript'], 'tsd') | ||
t.equal(pkg.scripts.unit, 'tap "test/**/*.test.js"') | ||
t.equal(pkg.dependencies['fastify-plugin'], cliPkg.devDependencies['fastify-plugin']) | ||
t.equal(pkg.scripts.unit, 'node --test') | ||
t.equal(pkg.dependencies['fastify-plugin'], cliPkg.dependencies['fastify-plugin']) | ||
t.equal(pkg.devDependencies['@types/node'], cliPkg.devDependencies['@types/node']) | ||
t.equal(pkg.devDependencies.fastify, cliPkg.devDependencies.fastify) | ||
t.equal(pkg.devDependencies.standard, cliPkg.devDependencies.standard) | ||
t.equal(pkg.devDependencies.tap, cliPkg.devDependencies.tap) | ||
t.equal(pkg.devDependencies.tsd, cliPkg.devDependencies.tsd) | ||
@@ -145,4 +143,2 @@ t.equal(pkg.devDependencies.typescript, cliPkg.devDependencies.typescript) | ||
const testGlob = pkg.scripts.unit.split(' ', 2)[1].replace(/"/g, '') | ||
t.equal(minimatch.match(['test/more/test/here/ok.test.js'], testGlob).length, 1) | ||
resolve() | ||
@@ -149,0 +145,0 @@ }) |
@@ -26,2 +26,5 @@ 'use strict' | ||
typescriptTemplate.type = 'module' | ||
typescriptTemplate.scripts.test = 'npm run build:ts && tsc -p test/tsconfig.json && FASTIFY_AUTOLOAD_TYPESCRIPT=1 node --test --experimental-test-coverage --loader ts-node/esm test/**/*.ts' | ||
;(function (cb) { | ||
@@ -105,3 +108,3 @@ const files = [] | ||
test('should finish successfully with typescript template', async (t) => { | ||
t.plan(25 + Object.keys(expected).length) | ||
t.plan(24 + Object.keys(expected).length) | ||
try { | ||
@@ -131,3 +134,3 @@ await generate(workdir, typescriptTemplate) | ||
t.ok(pkg.license === 'ISC' || pkg.license === 'MIT') | ||
t.equal(pkg.scripts.test, 'npm run build:ts && tsc -p test/tsconfig.json && tap --ts "test/**/*.test.ts"') | ||
t.equal(pkg.scripts.test, 'npm run build:ts && tsc -p test/tsconfig.json && FASTIFY_AUTOLOAD_TYPESCRIPT=1 node --test --experimental-test-coverage --loader ts-node/esm test/**/*.ts') | ||
t.equal(pkg.scripts.start, 'npm run build:ts && fastify start -l info dist/app.js') | ||
@@ -146,6 +149,5 @@ t.equal(pkg.scripts['build:ts'], 'tsc') | ||
t.equal(pkg.devDependencies.concurrently, cliPkg.devDependencies.concurrently) | ||
t.equal(pkg.devDependencies.tap, cliPkg.devDependencies.tap) | ||
t.equal(pkg.devDependencies.typescript, cliPkg.devDependencies.typescript) | ||
const testGlob = pkg.scripts.test.split(' ', 11)[10].replace(/"/g, '') | ||
const testGlob = pkg.scripts.test.split(' ', 15)[14] | ||
@@ -152,0 +154,0 @@ t.equal(minimatch.match(['test/routes/plugins/more/test/here/ok.test.ts'], testGlob).length, 1) |
@@ -104,3 +104,3 @@ 'use strict' | ||
test('should finish successfully with typescript template', async (t) => { | ||
t.plan(25 + Object.keys(expected).length) | ||
t.plan(24 + Object.keys(expected).length) | ||
try { | ||
@@ -130,3 +130,3 @@ await generate(workdir, typescriptTemplate) | ||
t.ok(pkg.license === 'ISC' || pkg.license === 'MIT') | ||
t.equal(pkg.scripts.test, 'npm run build:ts && tsc -p test/tsconfig.json && tap --ts "test/**/*.test.ts"') | ||
t.equal(pkg.scripts.test, 'npm run build:ts && tsc -p test/tsconfig.json && c8 node --test -r ts-node/register test/**/*.ts') | ||
t.equal(pkg.scripts.start, 'npm run build:ts && fastify start -l info dist/app.js') | ||
@@ -145,8 +145,7 @@ t.equal(pkg.scripts['build:ts'], 'tsc') | ||
t.equal(pkg.devDependencies.concurrently, cliPkg.devDependencies.concurrently) | ||
t.equal(pkg.devDependencies.tap, cliPkg.devDependencies.tap) | ||
t.equal(pkg.devDependencies.typescript, cliPkg.devDependencies.typescript) | ||
const testGlob = pkg.scripts.test.split(' ', 11)[10].replace(/"/g, '') | ||
const testGlob = pkg.scripts.test.split(' ', 14)[13] | ||
t.equal(minimatch.match(['test/routes/plugins/more/test/here/ok.test.ts'], testGlob).length, 1) | ||
t.equal(minimatch.match(['test/routes/plugins/more/test/here/ok.test.ts'], testGlob).length, 1, 'should match glob') | ||
resolve() | ||
@@ -153,0 +152,0 @@ }) |
@@ -109,3 +109,3 @@ 'use strict' | ||
test('should finish succesfully with javascript template', async (t) => { | ||
t.plan(14 + Object.keys(expected).length) | ||
t.plan(13 + Object.keys(expected).length) | ||
try { | ||
@@ -121,3 +121,3 @@ await generate(workdir, javascriptTemplate) | ||
test('--integrate option will enhance preexisting package.json and overwrite preexisting files', async (t) => { | ||
t.plan(14 + Object.keys(expected).length) | ||
t.plan(13 + Object.keys(expected).length) | ||
try { | ||
@@ -165,3 +165,3 @@ await generate(workdir, javascriptTemplate) | ||
t.ok(pkg.license === 'ISC' || pkg.license === 'MIT') | ||
t.equal(pkg.scripts.test, 'tap "test/**/*.test.js"') | ||
t.equal(pkg.scripts.test, 'node --test test/**/*.test.js') | ||
t.equal(pkg.scripts.start, 'fastify start -l info app.js') | ||
@@ -174,5 +174,4 @@ t.equal(pkg.scripts.dev, 'fastify start -w -l info -P app.js') | ||
t.equal(pkg.dependencies['@fastify/sensible'], cliPkg.devDependencies['@fastify/sensible']) | ||
t.equal(pkg.devDependencies.tap, cliPkg.devDependencies.tap) | ||
const testGlob = pkg.scripts.test.split(' ', 2)[1].replace(/"/g, '') | ||
const testGlob = pkg.scripts.test.split(' ', 3)[2] | ||
t.equal(minimatch.match(['test/services/plugins/more/test/here/ok.test.js'], testGlob).length, 1) | ||
@@ -179,0 +178,0 @@ resolve() |
@@ -13,3 +13,7 @@ 'use strict' | ||
test('should print plugins', async t => { | ||
const { NYC_PROCESS_ID, NODE_V8_COVERAGE } = process.env | ||
const SHOULD_SKIP = NYC_PROCESS_ID || NODE_V8_COVERAGE | ||
// This test should be skipped when coverage reporting is used since outputs won't match | ||
test('should print plugins', { skip: SHOULD_SKIP }, async t => { | ||
t.plan(3) | ||
@@ -29,4 +33,4 @@ | ||
// This never exits in CI for some reason | ||
test('should plugins routes via cli', { skip: process.env.CI }, async t => { | ||
// This test should be skipped when coverage reporting is used since outputs won't match | ||
test('should plugins routes via cli', { skip: SHOULD_SKIP }, async t => { | ||
t.plan(1) | ||
@@ -96,3 +100,4 @@ const { stdout } = await exec('node cli.js print-plugins ./examples/plugin.js', { encoding: 'utf-8', timeout: 10000 }) | ||
test('should print plugins of server with an async/await plugin', async t => { | ||
// This test should be skipped when coverage reporting is used since outputs won't match | ||
test('should print plugins of server with an async/await plugin', { skip: SHOULD_SKIP }, async t => { | ||
const nodeMajorVersion = process.versions.node.split('.').map(x => parseInt(x, 10))[0] | ||
@@ -99,0 +104,0 @@ if (nodeMajorVersion < 7) { |
@@ -12,2 +12,4 @@ 'use strict' | ||
const test = tap.test | ||
const { NYC_PROCESS_ID, NODE_V8_COVERAGE } = process.env | ||
const SHOULD_SKIP = NYC_PROCESS_ID || NODE_V8_COVERAGE | ||
@@ -29,3 +31,3 @@ test('should print routes', async t => { | ||
// This never exits in CI for some reason | ||
test('should print routes via cli', { skip: process.env.CI }, async t => { | ||
test('should print routes via cli', { skip: SHOULD_SKIP }, async t => { | ||
t.plan(1) | ||
@@ -32,0 +34,0 @@ const { stdout } = await exec('node cli.js print-routes ./examples/plugin.js', { encoding: 'utf-8', timeout: 10000 }) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
205850
22
164
5086