Skip to content

Commit

Permalink
Combine tests, since it was 99% duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Sep 26, 2024
1 parent 298607e commit 730e793
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions tests/default.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,24 @@ const blueprintPath = join(__dirname, '..');
const appName = 'fancy-app-in-test';

const FLAG_SETS = [
[
/* none, default */
],
['--typescript'],
{
flags: [
/* none, default */
],
fixturePath: join(__dirname, 'fixture'),
},
{
flags: ['--typescript'],
fixturePath: join(__dirname, 'fixture-ts'),
},
];

describe('basic functionality', function () {
let tmpDir;
let emberCli = `[email protected]`;

for (let flagSet of FLAG_SETS) {
describe(`with flags: '${flagSet.join(' ')}'`, function () {
for (let { flags, fixturePath } of FLAG_SETS) {
describe(`with flags: '${flags.join(' ')}'`, function () {
beforeAll(async () => {
tmpDir = await tmp.dir({ unsafeCleanup: true });

Expand All @@ -33,6 +39,7 @@ describe('basic functionality', function () {
blueprintPath,
'--pnpm',
'--skip-git',
...flags,
];

await execa('npx', emberCliArgs, {

Check failure on line 45 in tests/default.test.mjs

View workflow job for this annotation

GitHub Actions / Test

tests/default.test.mjs > basic functionality > with flags: '--typescript'

ExecaError: Command failed with exit code 1: npx '[email protected]' new fancy-app-in-test -b /home/runner/work/app-blueprint/app-blueprint --pnpm --skip-git --typescript Command failed with exit code 1: pnpm lint:fix > [email protected] lint:fix /tmp/tmp-1864-xXbSULpiIhOJ/fancy-app-in-test > concurrently "pnpm:lint:*:fix" --names "fix:" --prefixColors auto [fix:hbs] [fix:hbs] > [email protected] lint:hbs:fix /tmp/tmp-1864-xXbSULpiIhOJ/fancy-app-in-test [fix:hbs] > ember-template-lint . --fix [fix:hbs] [fix:js] [fix:js] > [email protected] lint:js:fix /tmp/tmp-1864-xXbSULpiIhOJ/fancy-app-in-test [fix:js] > eslint . --fix [fix:js] [fix:css] [fix:css] > [email protected] lint:css:fix /tmp/tmp-1864-xXbSULpiIhOJ/fancy-app-in-test [fix:css] > concurrently "pnpm:lint:css -- --fix" [fix:css] [fix:js] [fix:js] Oops! Something went wrong! :( [fix:js] [fix:js] ESLint: 9.11.1 [fix:js] [fix:js] ESLint couldn't find an eslint.config.(js|mjs|cjs) file. [fix:js] [fix:js] From ESLint v9.0.0, the default configuration file is now eslint.config.js. [fix:js] If you are using a .eslintrc.* file, please follow the migration guide [fix:js] to update your configuration file to the new format: [fix:js] [fix:js] https://eslint.org/docs/latest/use/configure/migration-guide [fix:js] [fix:js] If you still have problems after following the migration guide, please stop by [fix:js] https://eslint.org/chat/help to chat with the team. [fix:js] [fix:js] \u2009ELIFECYCLE\u2009 Command failed with exit code 2. [fix:js] pnpm run lint:js:fix exited with code 2 [fix:hbs] [fix:hbs] pnpm run lint:hbs:fix exited with code 0 [fix:css] [lint:css] [fix:css] [lint:css] > [email protected] lint:css /tmp/tmp-1864-xXbSULpiIhOJ/fancy-app-in-test [fix:css] [lint:css] > stylelint "**/*.css" "--" "--fix" [fix:css] [lint:css] [fix:css] [lint:css] pnpm run lint:css -- --fix exited with code 0 [fix:css] pnpm run lint:css:fix exited with code 0 \u2009ELIFECYCLE\u2009 Command failed with exit code 1. ================================================================================= ENV Summary: TIME: Thu Sep 26 2024 18:55:58 GMT+0000 (Coordinated Universal Time) TITLE: ember ARGV: - /opt/hostedtoolcache/node/18.20.4/x64/bin/node - /home/runner/.npm/_npx/4c14718e5aaa154d/node_modules/.bin/ember - new - fancy-app-in-test - -b - /home/runner/work/app-blueprint/app-blueprint - --pnpm - --skip-git - --typescript EXEC_PATH: /opt/hostedtoolcache/node/18.20.4/x64/bin/node TMPDIR: /tmp SHELL: /bin/bash PATH: - /home/runner/.npm/_npx/4c14718e5aaa154d/node_modules/.bin - /tmp/tmp-1864-xXbSULpiIhOJ/node_modules/.bin - /tmp/node_modules/.bin - /node_modules/.bin - /opt/hostedtoolcache/node/18.20.4/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin - /tmp/tmp-1864-xXbSULpiIhOJ/node_modules/.bin - /tmp/node_modules/.bin - /node_modules/.bin - /home/runner/work/app-blueprint/app-blueprint/node_modules/.bin - /home/runner/setup-pnpm/node_modules/.pnpm/[email protected]/node_modules/pnpm/dist/node-gyp-bin - /opt/hostedtoolcache/node/18.20.4/x64/bin - /home/runner/setup-pnpm/node_modules/.bin - /snap/bin - /home/runner/.local/bin - /opt/pipx_bin - /home/runner/.cargo/bin - /home/runner/.config/composer/vendor/bin - /usr/local/.ghcup/bin - /home/runner/.dotnet/tools - /usr/local/sbin - /usr/local/bin - /usr/sbin - /usr/bin - /sbin - /bin - /usr/games - /usr/local/games - /snap/bin PLATFORM: linux x64 FREEMEM: 14488510464 TOTALMEM: 16766771200 UPTIME: 302.67 LOADAVG: 1.91,0.9,0.35 CPUS: - AMD EPYC 7763 64-Core Processor - 3243 - AMD EPYC 7763 64-Core Processor - 3236 - AMD EPYC 7763 64-Core Processor - 3186 - AMD EPYC 7763 64-Core Processor - 3259 ENDIANNESS: LE VERSIONS: - acorn: 8.11.3 - ada: 2.7.8 - ares: 1.28.1 - base64: 0.5.2 - brotli: 1.0.9 - cjs_module_lexer: 1.2.2 - cldr: 44.1 - icu: 74.2 - llhttp: 6.1.1 - modules: 108 - napi: 9 - nghttp2: 1.61.0 - nghttp3: 0.7.0 - ngtcp2: 1.3.0 - node:
Expand All @@ -41,13 +48,9 @@ describe('basic functionality', function () {
});

// apply the fixture on top of the generated app
copyWithTemplate(
join(__dirname, 'fixture'),
join(tmpDir.path, appName),
{
name: appName,
},
);
copyWithTemplate(fixturePath, join(tmpDir.path, appName), {
name: appName,
});

// Sync the lints for the fixtures with the project's config
await execa(`pnpm`, ['lint:fix'], {
Expand Down

0 comments on commit 730e793

Please sign in to comment.