Skip to content

Commit

Permalink
feat(node): update to work with node 14 (#17)
Browse files Browse the repository at this point in the history
Fixes #16
  • Loading branch information
James Singleton authored May 22, 2020
1 parent 525db70 commit ad8663a
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 39 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ jest-preset.json
.DS_Store
npm-debug.log

# build
*.tgz

# webstorm
.idea
17 changes: 9 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
language: node_js
node_js:
- 10
- 12
- 14
before_install:
# Create a master branch for commitlint
# https://github.com/conventional-changelog/commitlint/issues/6
- git remote set-branches origin master && git fetch
jobs:
include:
# Define the release stage that runs semantic-release
- stage: release
node_js:
- 10
- 12
before_install:
# Create a master branch for commitlint
# https://github.com/conventional-changelog/commitlint/issues/6
- git remote set-branches origin master && git fetch
deploy:
on:
branch: master
provider: script
skip_cleanup: true
script:
- npx semantic-release
- npx semantic-release
21 changes: 6 additions & 15 deletions __tests__/html-report-creator.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@ const merge = require('lodash/merge');
const mkdirp = require('mkdirp');
const fs = require('fs');

function prettyPrintHtml(rawHtml) {
return rawHtml.end({
pretty: true,
indent: ' ',
newline: '\n',
allowEmpty: false,
});
}

function buildMockResult(mockResult = {}) {
const defaultMockResult = {
numFailedTestSuites: 0,
Expand Down Expand Up @@ -97,7 +88,7 @@ describe('html-report-creator', () => {

createHtmlReport(mockResult);
expect(
prettyPrintHtml(fs.writeFileSync.mock.calls[0][1])
fs.writeFileSync.mock.calls[0][1]
).toMatchSnapshot();
});

Expand All @@ -119,7 +110,7 @@ describe('html-report-creator', () => {

createHtmlReport(mockResult);
expect(
prettyPrintHtml(fs.writeFileSync.mock.calls[0][1])
fs.writeFileSync.mock.calls[0][1]
).toMatchSnapshot();
});

Expand All @@ -129,7 +120,7 @@ describe('html-report-creator', () => {

createHtmlReport(mockResult);
expect(
prettyPrintHtml(fs.writeFileSync.mock.calls[0][1])
fs.writeFileSync.mock.calls[0][1]
).toMatchSnapshot();
});

Expand All @@ -151,7 +142,7 @@ describe('html-report-creator', () => {

createHtmlReport(mockResult);
expect(
prettyPrintHtml(fs.writeFileSync.mock.calls[0][1])
fs.writeFileSync.mock.calls[0][1]
).toMatchSnapshot();
});

Expand All @@ -173,7 +164,7 @@ describe('html-report-creator', () => {

createHtmlReport(mockResult);
expect(
prettyPrintHtml(fs.writeFileSync.mock.calls[0][1])
fs.writeFileSync.mock.calls[0][1]
).toMatchSnapshot();
});

Expand All @@ -195,7 +186,7 @@ describe('html-report-creator', () => {

createHtmlReport(mockResult);
expect(
prettyPrintHtml(fs.writeFileSync.mock.calls[0][1])
fs.writeFileSync.mock.calls[0][1]
).toMatchSnapshot();
});

Expand Down
11 changes: 9 additions & 2 deletions html-report-creator.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,15 @@ module.exports = (result) => {
});
}
});
writeFile(process.env.JEST_TEST_REPORT_PATH || path.join(process.cwd(), 'test-results/test-report.html'), htmlOutput);
writeFile(
process.env.JEST_TEST_REPORT_PATH || path.join(process.cwd(), 'test-results/test-report.html'),
htmlOutput.end({
pretty: true,
indent: ' ',
newline: '\n',
allowEmpty: false,
})
);

return result;
};

20 changes: 8 additions & 12 deletions package-lock.json

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

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"@semantic-release/changelog": "^5.0.0",
"@semantic-release/commit-analyzer": "^8.0.1",
"@semantic-release/git": "^9.0.0",
"amex-jest-preset": "*",
"eslint": "^6.8.0",
"eslint-config-amex": "^6.0.0",
"githook-scripts": "^1.0.1",
Expand Down Expand Up @@ -59,7 +58,7 @@
"author": "Andres Escobar <[email protected]> (https://github.com/anescobar1991)",
"license": "Apache-2.0",
"jest": {
"preset": "amex-jest-preset",
"preset": "./jest-preset.js",
"coveragePathIgnorePatterns": [
"<rootDir>/jest-setup.js",
"<rootDir>/commitlint.config.js"
Expand Down

0 comments on commit ad8663a

Please sign in to comment.