Skip to content

Commit

Permalink
Chore(integration): Add more integration tests. Covers inquirer, core…
Browse files Browse the repository at this point in the history
… & single prompt modules
  • Loading branch information
SBoudrias committed Jul 1, 2024
1 parent e686841 commit 6c764ac
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 7 deletions.
12 changes: 11 additions & 1 deletion integration/cjs/integration.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@
const test = require('node:test');
const assert = require('node:assert');
const { input } = require('@inquirer/prompts');
const { createPrompt } = require('@inquirer/core');
const defaultInput = require('@inquirer/input').default;

test('should export modules', () => {
test('[CJS] @inquirer/prompts should be exported', () => {
assert(input instanceof Function);
});

test('[CJS] @inquirer/input should be exported', () => {
assert(defaultInput instanceof Function);
});

test('[CJS] @inquirer/core should export createPrompt', () => {
assert(createPrompt instanceof Function);
});
5 changes: 4 additions & 1 deletion integration/cjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"node": ">=18"
},
"devDependencies": {
"@inquirer/prompts": "workspace:*"
"@inquirer/core": "workspace:*",
"@inquirer/input": "workspace:*",
"@inquirer/prompts": "workspace:*",
"inquirer": "workspace:*"
}
}
19 changes: 18 additions & 1 deletion integration/esm/integration.test.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
/* eslint-disable n/no-unsupported-features/node-builtins */
import { input } from '@inquirer/prompts';
import defaultInput from '@inquirer/input';
import { createPrompt } from '@inquirer/core';
import inquirer, { createPromptModule } from 'inquirer';
import test from 'node:test';
import assert from 'node:assert';

test('should export modules', () => {
test('[ESM] @inquirer/prompts should be exported', () => {
assert(input instanceof Function);
});

test('[ESM] @inquirer/input should be exported', () => {
assert(defaultInput instanceof Function);
});

test('[ESM] @inquirer/core should export createPrompt', () => {
assert(createPrompt instanceof Function);
});

test('[ESM] inquirer should be exported', () => {
assert(inquirer.prompt instanceof Function);
assert(inquirer.createPromptModule instanceof Function);
assert(createPromptModule instanceof Function);
});
5 changes: 4 additions & 1 deletion integration/esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"node": ">=18"
},
"devDependencies": {
"@inquirer/prompts": "workspace:*"
"@inquirer/core": "workspace:*",
"@inquirer/input": "workspace:*",
"@inquirer/prompts": "workspace:*",
"inquirer": "workspace:*"
}
}
12 changes: 9 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,10 @@ __metadata:
version: 0.0.0-use.local
resolution: "@inquirer/cjs-integration-tests@workspace:integration/cjs"
dependencies:
"@inquirer/core": "workspace:*"
"@inquirer/input": "workspace:*"
"@inquirer/prompts": "workspace:*"
inquirer: "workspace:*"
languageName: unknown
linkType: soft

Expand All @@ -410,7 +413,7 @@ __metadata:
languageName: unknown
linkType: soft

"@inquirer/core@npm:^9.0.0, @inquirer/core@workspace:packages/core":
"@inquirer/core@npm:^9.0.0, @inquirer/core@workspace:*, @inquirer/core@workspace:packages/core":
version: 0.0.0-use.local
resolution: "@inquirer/core@workspace:packages/core"
dependencies:
Expand Down Expand Up @@ -458,7 +461,10 @@ __metadata:
version: 0.0.0-use.local
resolution: "@inquirer/esm-integration-tests@workspace:integration/esm"
dependencies:
"@inquirer/core": "workspace:*"
"@inquirer/input": "workspace:*"
"@inquirer/prompts": "workspace:*"
inquirer: "workspace:*"
languageName: unknown
linkType: soft

Expand All @@ -479,7 +485,7 @@ __metadata:
languageName: unknown
linkType: soft

"@inquirer/input@npm:^2.1.12, @inquirer/input@workspace:packages/input":
"@inquirer/input@npm:^2.1.12, @inquirer/input@workspace:*, @inquirer/input@workspace:packages/input":
version: 0.0.0-use.local
resolution: "@inquirer/input@workspace:packages/input"
dependencies:
Expand Down Expand Up @@ -4423,7 +4429,7 @@ __metadata:
languageName: node
linkType: hard

"inquirer@workspace:packages/inquirer":
"inquirer@workspace:*, inquirer@workspace:packages/inquirer":
version: 0.0.0-use.local
resolution: "inquirer@workspace:packages/inquirer"
dependencies:
Expand Down

0 comments on commit 6c764ac

Please sign in to comment.