Skip to content

Commit

Permalink
test: tests are unreliable in Windows (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerbutler authored and keithamus committed Nov 7, 2019
1 parent daab31d commit 491edb9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
},
"devDependencies": {
"husky": "^1.1.1",
"newline": "0.0.3",
"semantic-release": "^15.9.17",
"validate-commit-msg": "^2.14.0"
}
Expand Down
8 changes: 7 additions & 1 deletion test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
const assert = require('assert');
const sortPackageJson = require('./');
const fs = require('fs');
const newline = require('newline');
const sortPackageJson = require('./');

fs.readFile('./package.json', 'utf8', (error, contents) => {
if (error) {
console.error(error.stack || error);
process.exit(1);
}

// Enforce LF line-endings. Windows git users often set core.autocrlf
// to true, so the file may have CRLF line endings.
contents = newline.set(contents, "LF");

const parsed = JSON.parse(contents);
assert.deepEqual(
typeof sortPackageJson(parsed),
Expand Down

0 comments on commit 491edb9

Please sign in to comment.