Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
feat(runtime): support node 16 (#624)
Browse files Browse the repository at this point in the history
  • Loading branch information
10xLaCroixDrinker authored Nov 29, 2021
1 parent 57ede96 commit f8752d6
Show file tree
Hide file tree
Showing 27 changed files with 299 additions and 237 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unit_test.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-version: [12.x, 14.x]
node-version: [12.x, 14.x, 16.x]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`createRequestHtmlFragment should catch any errors and call the next middleware 1`] = `
Array [
"error creating request HTML fragment for http://example.com/request",
[TypeError: Cannot read property 'dispatch' of undefined],
]
`;

exports[`createRequestHtmlFragment should preload data for matched route components 1`] = `
Array [
Object {
Expand Down
12 changes: 11 additions & 1 deletion __tests__/server/middleware/createRequestHtmlFragment.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,16 @@ describe('createRequestHtmlFragment', () => {

it('should catch any errors and call the next middleware', () => {
expect.assertions(3);
let error;
try {
let empty;
// Creating an error reading properties of undefined for tests to work in
// both Node 12 and 16 where the message has changed.
// eslint-disable-next-line no-unused-expressions
empty.dispatch;
} catch (err) {
error = err;
}
const createRequestHtmlFragment = require(
'../../../src/server/middleware/createRequestHtmlFragment'
).default;
Expand All @@ -255,7 +265,7 @@ describe('createRequestHtmlFragment', () => {
console.error = jest.fn();
middleware(req, res, next);
expect(console.error).toHaveBeenCalled();
expect(console.error.mock.calls[0]).toMatchSnapshot();
expect(console.error.mock.calls[0]).toEqual(['error creating request HTML fragment for http://example.com/request', error]);
expect(next).toHaveBeenCalled();
/* eslint-enable no-console */
});
Expand Down
Loading

0 comments on commit f8752d6

Please sign in to comment.