fastify-cli
Advanced tools
Comparing version 5.5.1 to 5.6.0
@@ -28,3 +28,7 @@ 'use strict' | ||
} else { | ||
template = 'eject' | ||
if (opts.esm) { | ||
template = 'eject-esm' | ||
} else { | ||
template = 'eject' | ||
} | ||
} | ||
@@ -31,0 +35,0 @@ |
@@ -9,3 +9,6 @@ Usage: fastify eject | ||
--esm | ||
use the ESM template | ||
--lang=ts, --lang=typescript | ||
use the TypeScript template |
@@ -42,4 +42,3 @@ 'use strict' | ||
const childEvent = { childEvent: event } | ||
const env = Object.assign({}, process.env, childEvent, require('dotenv').config().parsed) | ||
const env = Object.assign({}, require('dotenv').config().parsed, process.env, childEvent) | ||
const _child = cp.fork(forkPath, args, { | ||
@@ -46,0 +45,0 @@ env, |
{ | ||
"name": "fastify-cli", | ||
"version": "5.5.1", | ||
"version": "5.6.0", | ||
"description": "Run a fastify route with one command!", | ||
@@ -5,0 +5,0 @@ "main": "cli.js", |
@@ -18,3 +18,3 @@ 'use strict' | ||
const appTemplateDir = path.join(__dirname, '..', 'templates', 'eject') | ||
const { eject } = require('../eject') | ||
const { eject, cli } = require('../eject') | ||
const expected = {} | ||
@@ -69,2 +69,12 @@ | ||
test('should finish successfully with cli', async (t) => { | ||
try { | ||
process.chdir(workdir) | ||
await cli([]) | ||
await verifyCopy(t, expected) | ||
} catch (err) { | ||
t.error(err) | ||
} | ||
}) | ||
function verifyCopy (t, expected) { | ||
@@ -71,0 +81,0 @@ return new Promise((resolve, reject) => { |
@@ -645,3 +645,3 @@ /* global GLOBAL_MODULE_1, GLOBAL_MODULE_2 */ | ||
t.equal(r2.response.statusCode, 200) | ||
t.same(JSON.parse(r2.body), { hello: 'planet' }) | ||
t.same(JSON.parse(r2.body), { hello: 'world' }) /* world because when making a restart the server still passes the arguments that change the environment variable */ | ||
@@ -648,0 +648,0 @@ await fastifyEmitter.stop() |
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
171686
129
4230
97