Skip to content

Commit cdfcbd0

Browse files
committed
Fix regressions and test failures caused by npm package upgrades
1 parent 91e57ac commit cdfcbd0

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

babel.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
presets: [['@babel/preset-env', { targets: { node: 'current' } }]],
3+
sourceType: 'unambiguous',
4+
};

jest.config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,17 @@ module.exports = {
1414
'<rootDir>/test/browser/', // https://github.com/WebThingsIO/gateway/issues/3007
1515
],
1616
transform: {
17-
'\\.js$': 'babel-jest',
17+
'\\.[cm]?js$': ['babel-jest', {
18+
presets: [['@babel/preset-env', { targets: { node: 'current' } }]],
19+
sourceType: 'unambiguous',
20+
}],
1821
},
22+
transformIgnorePatterns: [
23+
'/node_modules/(?!(@exodus/bytes|@asamuzakjp|@bramus|@csstools|parse5|tough-cookie)/)',
24+
],
1925
setupFilesAfterEnv: [
2026
'<rootDir>/test/common.js',
2127
],
2228
testEnvironment: 'node',
29+
maxWorkers: 1,
2330
};

src/addon-manager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import fs from 'fs';
2222
import path from 'path';
2323
import rimraf from 'rimraf';
2424
import semver from 'semver';
25-
import tar from 'tar';
25+
import * as tar from 'tar';
2626
import os from 'os';
2727
import promisePipe from 'promisepipe';
2828
import fetch from 'node-fetch';
@@ -1068,6 +1068,7 @@ export class AddonManager extends EventEmitter {
10681068
['package']
10691069
);
10701070
} catch (e) {
1071+
console.error(`Error extracting package: ${e}`);
10711072
throw new Error(`Failed to extract package: ${e}`);
10721073
}
10731074

src/test/models/jsonwebtoken-test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ describe('JSONWebToken', () => {
3333
});
3434

3535
it('should fail to verify a JWT with the "none" alg', async () => {
36-
const pair = ec.generateKeyPair();
37-
const sig = jwt.sign({}, pair.private, {
36+
const sig = jwt.sign({}, '', {
3837
algorithm: 'none',
3938
keyid: uuidv4(),
4039
});

0 commit comments

Comments
 (0)