Merge pull request #199 from spotify/patriko/coverage

cli: test fixes n stuff
This commit is contained in:
Stefan Ålund
2020-03-09 10:43:23 +01:00
committed by GitHub
4 changed files with 8 additions and 4 deletions
+2 -2
View File
@@ -4,9 +4,9 @@
"scripts": {
"start": "yarn build && yarn workspace @spotify-backstage/app start",
"build": "lerna run build",
"test": "cross-env CI=true lerna run test --stream --parallel -- --coverage",
"test": "cross-env CI=true lerna run test -- --coverage",
"create-plugin": "backstage-cli create-plugin",
"lint": "lerna run lint --stream"
"lint": "lerna run lint"
},
"workspaces": {
"packages": [
@@ -97,7 +97,7 @@ describe('createPlugin', () => {
createTemporaryPluginFolder(tempDir);
movePlugin(tempDir, pluginDir, id);
expect(fs.existsSync(pluginDir)).toBe(true);
expect(pluginDir).toMatch(`/packages\/plugins\/${id}`);
expect(pluginDir).toMatch(`/plugins\/${id}`);
} finally {
del.sync(tempDir, { force: true });
del.sync(rootDir, { force: true });
@@ -8,6 +8,9 @@ export default async (cmd: Command) => {
if (cmd.watch) {
args.push('--watch');
}
if (cmd.coverage) {
args.push('--coverage');
}
try {
const result = spawnSync('web-scripts', args, { stdio: 'inherit' });
+2 -1
View File
@@ -6,7 +6,7 @@ import watch from './commands/watch-deps';
import pluginBuild from './commands/plugin/build';
import pluginLint from './commands/plugin/lint';
import pluginServe from './commands/plugin/serve';
import pluginTest from './commands/plugin/test';
import pluginTest from './commands/plugin/testCommand';
process.on('unhandledRejection', err => {
throw err;
@@ -41,6 +41,7 @@ const main = (argv: string[]) => {
program
.command('plugin:test')
.option('--watch', 'Enable watch mode')
.option('--coverage', 'Report test coverage')
.description('Run all tests for a plugin')
.action(pluginTest);