Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(node): update to work with node 14 #17

Merged
merged 4 commits into from
May 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
PixnBits marked this conversation as resolved.
Show resolved Hide resolved

# 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 <andres.escobar@aexp.com> (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