-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(esm): worked around the fact that
__dirname
is not defined for esm
- Loading branch information
Showing
9 changed files
with
221 additions
and
10 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 |
---|---|---|
@@ -1 +1,7 @@ | ||
{"ui":"tdd","require":["@babel/register","./test/mocha-setup.js"]} | ||
{ | ||
"ui": "tdd", | ||
"require": [ | ||
"@babel/register", | ||
"./test/mocha-setup.js" | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const base = { | ||
formatOptions: {snippetInterface: 'async-await'}, | ||
import: ['test/integration/features/**/*.mjs'], | ||
publishQuiet: true | ||
}; | ||
|
||
export default base; | ||
|
||
export const wip = { | ||
...base, | ||
tags: '@wip and not @skip' | ||
}; | ||
|
||
export const noWip = { | ||
...base, | ||
tags: 'not @skip and not @wip' | ||
}; | ||
|
||
export const focus = { | ||
...base, | ||
tags: '@focus' | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Feature: scaffold | ||
|
||
Scenario: new project | ||
When the project is scaffolded | ||
Then the testing framework is configured | ||
And a canary test exists to ensure the framework configuration works |
23 changes: 23 additions & 0 deletions
23
test/integration/features/step_definitions/common-steps.mjs
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {resolve} from 'path'; | ||
import filedirname from 'filedirname'; | ||
// eslint-disable-next-line import/no-extraneous-dependencies,import/no-unresolved | ||
import {scaffold} from '@form8ion/mocha-scaffolder'; | ||
|
||
import {Before, When} from '@cucumber/cucumber'; | ||
import stubbedFs from 'mock-fs'; | ||
|
||
const [, __dirname] = filedirname(); | ||
const pathToProjectRoot = [__dirname, '..', '..', '..', '..']; | ||
|
||
Before(function () { | ||
stubbedFs({ | ||
node_modules: stubbedFs.load(resolve(...([...pathToProjectRoot, 'node_modules']))), | ||
templates: stubbedFs.load(resolve(...([...pathToProjectRoot, 'templates']))) | ||
}); | ||
}) | ||
|
||
When('the project is scaffolded', async function () { | ||
this.scaffoldRoot = process.cwd(); | ||
|
||
await scaffold({projectRoot: this.scaffoldRoot}); | ||
}); |
13 changes: 13 additions & 0 deletions
13
test/integration/features/step_definitions/configuration-steps.mjs
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import {Then} from '@cucumber/cucumber'; | ||
import {fileExists} from '@form8ion/core'; | ||
|
||
import {assert} from 'chai'; | ||
|
||
Then('the testing framework is configured', async function () { | ||
assert.isTrue(await fileExists(`${this.scaffoldRoot}/.mocharc.json`)); | ||
assert.isTrue(await fileExists(`${this.scaffoldRoot}/test/mocha-setup.js`)); | ||
}); | ||
|
||
Then('a canary test exists to ensure the framework configuration works', async function () { | ||
assert.isTrue(await fileExists(`${this.scaffoldRoot}/src/canary-test.js`)); | ||
}); |