Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

Commit

Permalink
add afterall to correct working directory
Browse files Browse the repository at this point in the history
  • Loading branch information
kristw committed Nov 7, 2018
1 parent 73ba1fe commit 2041ec9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"displayName": "generator-superset",
"rootDir": "<rootDir>/packages/generator-superset",
"testMatch": [
"<rootDir>/packages/generator-superset/**/?(*.)+(spec|test).{js,jsx}"
"<rootDir>/test/**/?(*.)+(spec|test).{js,jsx}"
]
}
]
Expand Down
15 changes: 13 additions & 2 deletions packages/generator-superset/test/app.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,21 @@ const assert = require('yeoman-assert');
const helpers = require('yeoman-test');

describe('generator-superset:app', () => {
beforeAll(() =>
helpers.run(path.join(__dirname, '../generators/app')).withPrompts({ name: 'my-package' }));
let dir;

beforeAll(() => {
dir = process.cwd();

return helpers
.run(path.join(__dirname, '../generators/app'))
.withPrompts({ name: 'my-package' });
});

it('creates files', () => {
assert.file(['package.json', 'README.md', 'src/index.js', 'test/index.test.js']);
});

afterAll(() => {
process.chdir(dir);
});
});
15 changes: 12 additions & 3 deletions packages/generator-superset/test/package.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,22 @@ const assert = require('yeoman-assert');
const helpers = require('yeoman-test');

describe('generator-superset:package', () => {
beforeAll(() =>
helpers
let dir;

beforeAll(() => {
dir = process.cwd();

return helpers
.run(path.join(__dirname, '../generators/package'))
.withPrompts({ name: 'my-package' })
.withOptions({ skipInstall: true }));
.withOptions({ skipInstall: true });
});

it('creates files', () => {
assert.file(['package.json', 'README.md', 'src/index.js', 'test/index.test.js']);
});

afterAll(() => {
process.chdir(dir);
});
});

0 comments on commit 2041ec9

Please sign in to comment.