Skip to content

Commit

Permalink
Merge 74fd71f into 3021494
Browse files Browse the repository at this point in the history
  • Loading branch information
OmgImAlexis committed Apr 24, 2017
2 parents 3021494 + 74fd71f commit dc55fef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules
!test/fixtures/project/node_modules
.nyc_output
coverage
yarn.lock
9 changes: 9 additions & 0 deletions test/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,12 @@ test('quiet option', async t => {
const err = await t.throws(execa('../cli.js', ['--no-local', '--quiet', '--reporter=compact', filepath]));
t.is(err.stdout.indexOf('warning'), -1);
});

test('init option', async t => {
const filepath = await tempWrite('{}', 'package.json');
await execa(path.join(__dirname, '../cli.js'), ['--init'], {
cwd: filepath.replace('package.json', '')
});
const packagejson = await fs.readFileSync(filepath, 'utf8');
t.regex(JSON.stringify(JSON.parse(packagejson)), /{"scripts":{"test":"xo"},"devDependencies":{"xo":"\^[0-9]+\.[0-9]+\.[0-9]+"}}/);
});

0 comments on commit dc55fef

Please sign in to comment.