Skip to content

Commit

Permalink
Fix: Windows #3
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbankhead committed Jun 22, 2017
1 parent e8f0968 commit 820b02b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,17 @@ tape('cli', (t) => {

t.throws(cli.updateSequenceFile, `cli.updateSequenceFile should throw if no arguments are passed`)
t.throws(cli.generateIds, `cli.generateIds should throw if no arguments are passed`)
if (process.platform !== 'win32') {
t.throws(() => { cli.makeNestedDirectory('/somedir') }, `cli.makeNestedDirectory should throw on bad permissions`)
} else {
t.throws(() => { cli.makeNestedDirectory(path.join('/', 'Windows', 'System', 'somedir')) }, `cli.makeNestedDirectory should throw on bad permissions`)
}
t.doesNotThrow(cli.makeNestedDirectory, `cli.makeNestedDirectory should not throw if no arguments are passed`)
t.doesNotThrow(cli.readFromSequenceFile, `cli.readFromSequenceFile should not throw if no arguments are passed`)

fs.writeFileSync('.someFileNotDirForBronzeTest', 'test')

t.throws(() => {
cli.makeNestedDirectory(path.join('.someFileNotDirForBronzeTest', 'someotherdir'))
}, `cli.makeNestedDirectory should throw when cannot make directory`)

fs.unlinkSync('.someFileNotDirForBronzeTest')

cli.output = undefined

t.equal(cli.output, console.log, `cli.setOutput should default to console.log when set to \`undefined\``)
Expand Down

0 comments on commit 820b02b

Please sign in to comment.