Skip to content

Commit

Permalink
test: Fix smoke tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
darkobits committed Jul 8, 2023
1 parent c87cb71 commit ee4623f
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/fixtures/cjs/js-extension/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ async function implicitCjs() {
const cli = await import('../../../../dist/index.js');

cli.command({
builder: ({ command }) => {
command.option('foo', {
type: 'string',
required: false
});
},
handler: ({ config }) => {
if (config && Object.keys(config).length > 0) {
log.verbose(log.prefix('cjs:js-extension'), log.chalk.green('success'));
Expand Down
6 changes: 6 additions & 0 deletions tests/fixtures/cjs/mjs-extension/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ async function explicitEsm() {
const cli = await import('../../../../dist/index.js');

cli.command({
builder: ({ command }) => {
command.option('foo', {
type: 'string',
required: false
});
},
handler: ({ config }) => {
if (config && Object.keys(config).length > 0) {
log.verbose(log.prefix('cjs:mjs-extension'), log.chalk.green('success'));
Expand Down
6 changes: 6 additions & 0 deletions tests/fixtures/cjs/mts-extension/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ async function mtsToCjs() {
const cli = await import('../../../../dist/index.js');

cli.command({
builder: ({ command }) => {
command.option('foo', {
type: 'string',
required: false
});
},
handler: ({ config }) => {
if (config && Object.keys(config).length > 0) {
log.verbose(log.prefix('cjs:mts-extension'), log.chalk.green('success'));
Expand Down
6 changes: 6 additions & 0 deletions tests/fixtures/cjs/ts-extension/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ async function typeScriptToCjs() {
const cli = await import('../../../../dist/index.js');

cli.command({
builder: ({ command }) => {
command.option('foo', {
type: 'string',
required: false
});
},
handler: ({ config }) => {
if (config && Object.keys(config).length > 0) {
log.verbose(log.prefix('cjs:ts-extension'), log.chalk.green('success'));
Expand Down
6 changes: 6 additions & 0 deletions tests/fixtures/esm/cjs-extension/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ const log = LogFactory({ heading: 'smokeTest' });
function explicitCjs() {
try {
cli.command({
builder: ({ command }) => {
command.option('foo', {
type: 'string',
required: false
});
},
handler: ({ config }) => {
if (config && Object.keys(config).length > 0) {
log.verbose(log.prefix('esm:cjs-extension'), log.chalk.green('success'));
Expand Down
6 changes: 6 additions & 0 deletions tests/fixtures/esm/cts-extension/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ const log = LogFactory({ heading: 'smokeTest' });
function explicitTypeScriptToCjs() {
try {
cli.command({
builder: ({ command }) => {
command.option('foo', {
type: 'string',
required: false
});
},
handler: ({ config }) => {
if (config && Object.keys(config).length > 0) {
log.verbose(log.prefix('esm:cts-extension'), log.chalk.green('success'));
Expand Down
6 changes: 6 additions & 0 deletions tests/fixtures/esm/js-extension/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ const log = LogFactory({ heading: 'smokeTest' });
function implicitEsm() {
try {
cli.command({
builder: ({ command }) => {
command.option('foo', {
type: 'string',
required: false
});
},
handler: ({ config }) => {
if (config && Object.keys(config).length > 0) {
log.verbose(log.prefix('esm:js-extension'), log.chalk.green('success'));
Expand Down
6 changes: 6 additions & 0 deletions tests/fixtures/esm/ts-extension/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ const log = LogFactory({ heading: 'smokeTest' });
function typeScriptToImplicitEsm() {
try {
cli.command({
builder: ({ command }) => {
command.option('foo', {
type: 'string',
required: false
});
},
handler: ({ config }) => {
if (config && Object.keys(config).length > 0) {
log.verbose(log.prefix('esm:ts-extension'), log.chalk.green('success'));
Expand Down

0 comments on commit ee4623f

Please sign in to comment.