diff --git a/bin/dev b/bin/dev deleted file mode 100755 index c29a7dc..00000000 --- a/bin/dev +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env node -require("dotenv").config(); -const oclif = require('@oclif/core') - -const path = require('path') -const project = path.join(__dirname, '..', 'tsconfig.json') - -// In dev mode -> use ts-node and dev plugins -process.env.NODE_ENV = 'development' - -require("ts-node").register({ project }); - -// In dev mode, always show stack traces -oclif.settings.debug = true; - -// Start the CLI -oclif.run().then(oclif.flush).catch(oclif.Errors.handle) diff --git a/bin/dev.js b/bin/dev.js new file mode 100755 index 00000000..5cd9701 --- /dev/null +++ b/bin/dev.js @@ -0,0 +1,6 @@ +#!/usr/bin/env node_modules/.bin/ts-node +// eslint-disable-next-line node/shebang, unicorn/prefer-top-level-await +(async () => { + const oclif = await import('@oclif/core'); + await oclif.execute({ development: true, dir: __dirname }); +})(); \ No newline at end of file diff --git a/bin/run b/bin/run deleted file mode 100755 index a7635de..00000000 --- a/bin/run +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env node - -const oclif = require('@oclif/core') - -oclif.run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle')) diff --git a/bin/run.js b/bin/run.js new file mode 100755 index 00000000..1024bac --- /dev/null +++ b/bin/run.js @@ -0,0 +1,7 @@ +#!/usr/bin/env node + +// eslint-disable-next-line unicorn/prefer-top-level-await +(async () => { + const oclif = await import('@oclif/core'); + await oclif.execute({ development: false, dir: __dirname }); +})(); \ No newline at end of file diff --git a/test/unit/adapters/file-upload.test.ts b/test/unit/adapters/file-upload.test.ts index 7eeb7f9..6b1aea8 100644 --- a/test/unit/adapters/file-upload.test.ts +++ b/test/unit/adapters/file-upload.test.ts @@ -152,7 +152,8 @@ describe('File Upload', () => { { name: 'NextJs', value: 'NEXTJS' }, { name: 'Other', value: 'OTHER' }, ], - outputDirectories:"" + outputDirectories:"", + supportedFrameworksForServerCommands: ['ANGULAR', 'OTHER', 'REMIX'] }, }; let archiveMockData = { zipName: 'abc.zip', zipPath: 'path/to/zip', projectName: 'test' }; diff --git a/test/unit/adapters/github.test.ts b/test/unit/adapters/github.test.ts index 2dd8296..b2fa6f0 100644 --- a/test/unit/adapters/github.test.ts +++ b/test/unit/adapters/github.test.ts @@ -163,6 +163,8 @@ describe('GitHub', () => { { name: 'Other', value: 'OTHER' }, ], repository: { fullName: 'Gatsby Starter' }, + outputDirectories:"", + supportedFrameworksForServerCommands: ['ANGULAR', 'OTHER', 'REMIX'] }, }; beforeEach(function () { diff --git a/test/unit/util/log.test.ts b/test/unit/util/log.test.ts index c9d0c17..015cdcc 100644 --- a/test/unit/util/log.test.ts +++ b/test/unit/util/log.test.ts @@ -12,12 +12,18 @@ describe('Log Util', () => { }; beforeEach(() => { createLoggerStub = stub(winston, 'createLogger'); - processExitStub = stub(process, 'exit'); + if (!process.exit.restore) { + processExitStub = stub(process, 'exit'); + } else { + processExitStub = process.exit; + } }); afterEach(() => { createLoggerStub.restore(); - processExitStub.restore(); + if (processExitStub.restore) { + processExitStub.restore(); + } }); it('should create a logger with file and console transports when project base path exists', () => {