forked from vuejs/vue-cli
-
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.
- Loading branch information
Showing
8 changed files
with
59 additions
and
9 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
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,5 @@ | ||
{ | ||
"rules": { | ||
"vue-libs/no-async-functions": 0 | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
packages/@vue/cli-plugin-unit-jest/__tests__/jestGenerator.spec.js
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,25 @@ | ||
const generateWithPlugin = require('@vue/cli-test-utils/generateWithPlugin') | ||
|
||
test('base', async () => { | ||
const { pkg, files } = await generateWithPlugin([ | ||
{ | ||
id: 'unit-jest', | ||
apply: require('../generator'), | ||
options: {} | ||
}, | ||
// mock presence of the eslint plugin | ||
{ | ||
id: 'eslint', | ||
apply: () => {}, | ||
options: {} | ||
} | ||
]) | ||
|
||
expect(pkg.scripts.test).toBeTruthy() | ||
expect(pkg.devDependencies).toHaveProperty('@vue/test-utils') | ||
expect(pkg.devDependencies).toHaveProperty('babel-jest') | ||
expect(files['test/unit/.eslintrc']).toMatch('"jest": true') | ||
|
||
const spec = files['test/unit/HelloWorld.spec.js'] | ||
expect(spec).toMatch(`expect(wrapper.text()).toMatch(msg)`) | ||
}) |
13 changes: 13 additions & 0 deletions
13
packages/@vue/cli-plugin-unit-jest/__tests__/jestPlugin.spec.js
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 @@ | ||
jest.setTimeout(20000) | ||
|
||
const create = require('@vue/cli-test-utils/createTestProject') | ||
|
||
test('should work', async () => { | ||
const project = await create('unit-jest', { | ||
plugins: { | ||
'@vue/cli-plugin-babel': {}, | ||
'@vue/cli-plugin-unit-jest': {} | ||
} | ||
}) | ||
await project.run(`vue-cli-service test`) | ||
}) |
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