-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Combine tests, since it was 99% duplication
- Loading branch information
1 parent
298607e
commit 730e793
Showing
1 changed file
with
16 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 }); | ||
|
||
|
@@ -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 GitHub Actions / Testtests/default.test.mjs > basic functionality > with flags: '--typescript'
|
||
|
@@ -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'], { | ||
|