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: support node 18, 20 & 21 #121

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
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
key: ${{ runner.os }}-lint-modules-${{ hashFiles('**/yarn.lock') }}
- uses: actions/setup-node@v2
with:
node-version: 16.x
node-version: 20.x
- run: yarn install
- run: yarn run lint

Expand All @@ -24,6 +24,9 @@ jobs:
node-version:
- 14.x
- 16.x
- 18.x
- 20.x
- 21.x
steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Automatically generate component files from TypeScript classes for the Components.js dependency injection framework",
"main": "index.js",
"engines": {
"node": ">=12.0"
"node": ">=14"
},
"scripts": {
"build": "tsc",
Expand Down
9 changes: 7 additions & 2 deletions test/parse/PackageMetadataLoader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,13 @@ describe('PackageMetadataLoader', () => {
resolutionContext.contentsOverrides = {
[normalizeFilePath('/package.json')]: `{`,
};
await expect(loader.load('/')).rejects
.toThrow(new Error(`Invalid package: Syntax error in ${normalizeFilePath('/package.json')}: Unexpected end of JSON input`));
await expect(loader.load('/')).rejects.toMatchObject({
name: 'Error',
message: expect.stringMatching(
/* eslint-disable max-len */
/Invalid package: Syntax error in .*\/package.json: (Unexpected end of JSON input|Expected property name or '\}')/u,
),
});
});

it('should error when lsd:module is missing', async() => {
Expand Down
5 changes: 4 additions & 1 deletion test/serialize/ComponentConstructor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2221,7 +2221,10 @@ describe('ComponentConstructor', () => {
defaults: [{ type: 'raw', value: '{"a":invalid}' }],
comment: 'Hi',
}, parameters, 'mp:components/a/b/file-param.jsonld#MyClass_field', scope))
.rejects.toThrow(`JSON parsing error in default value of mp:components/a/b/file-param.jsonld#MyClass_field: Unexpected token i in JSON at position 5`);
.rejects.toThrow(
/* eslint-disable max-len */
/JSON parsing error in default value of mp:components\/a\/b\/file-param.jsonld#MyClass_field: Unexpected token (i in JSON at position 5|'i', "\{"a":invalid\}" is not valid JSON)/u,
);
});
});

Expand Down
Loading
Loading