Skip to content

Commit

Permalink
fix(node): fix node versions. Fix issue with node16
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew-Mallimo authored and 10xLaCroixDrinker committed Jan 25, 2022
1 parent e300a41 commit 6c82e70
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
node-version: 16
- name: Install dependencies
run: npm ci
- name: Release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '10.x', '12.x', '14.x' ]
node: [ '12.x', '14.x', '16.x' ]
name: Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v2
Expand Down
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: 10 additions & 1 deletion html-report-creator.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,16 @@ 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;
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
],
"contributors": [
"Andres Escobar",
"Jimmy King"
"Jamie King"
],
"author": "Andres Escobar <[email protected]> (https://github.com/anescobar1991)",
"license": "Apache-2.0",
Expand Down

0 comments on commit 6c82e70

Please sign in to comment.