Update chai utility modules

Updating chai will be done in a future PR as it requires overhauling all
tests since chai is now ESM

Change-type: patch
This commit is contained in:
Felipe Lalanne 2025-01-22 10:43:45 -03:00
parent 3fbd98e218
commit 3a3889546d
No known key found for this signature in database
GPG Key ID: 03E696BFD472B26A
3 changed files with 88 additions and 42 deletions

115
package-lock.json generated
View File

@ -18,8 +18,8 @@
"@balena/es-version": "^1.0.3",
"@balena/lint": "^8.0.2",
"@types/bluebird": "^3.5.42",
"@types/chai": "^4.3.14",
"@types/chai-as-promised": "^7.1.8",
"@types/chai": "^4.3.20",
"@types/chai-as-promised": "^8.0.1",
"@types/chai-like": "^1.1.3",
"@types/chai-things": "0.0.38",
"@types/common-tags": "^1.8.4",
@ -48,9 +48,9 @@
"balena-request": "^13.3.1",
"blinking": "^1.0.1",
"bluebird": "^3.7.2",
"chai": "^4.3.4",
"chai-as-promised": "^7.1.1",
"chai-like": "^1.1.1",
"chai": "^4.5.0",
"chai-as-promised": "^8.0.1",
"chai-like": "^1.1.3",
"chai-things": "^0.2.0",
"chokidar": "^3.5.1",
"common-tags": "^1.8.0",
@ -317,6 +317,7 @@
"resolved": "https://registry.npmjs.org/@balena/compose/-/compose-3.2.1.tgz",
"integrity": "sha512-5p8UdOsXSRDqKQm2tYE5oV4jBqUoAC9xmbwL05aJycu2KDHDPy/lbo0LZy1lB7hQZSxPmAyG+3/bFz112wMesQ==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"ajv": "^6.12.3",
"docker-file-parser": "^1.0.7",
@ -1284,16 +1285,18 @@
"dev": true
},
"node_modules/@types/chai": {
"version": "4.3.14",
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.14.tgz",
"integrity": "sha512-Wj71sXE4Q4AkGdG9Tvq1u/fquNz9EdG4LIJMwVVII7ashjD/8cf8fyIfJAjRr6YcsXnSE8cOGQPq1gqeR8z+3w==",
"dev": true
"version": "4.3.20",
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.20.tgz",
"integrity": "sha512-/pC9HAB5I/xMlc5FP77qjCnI16ChlJfW0tGa0IUcFn38VJrTV6DeZ60NU5KZBtaOZqjdpwTWohz5HU1RrhiYxQ==",
"dev": true,
"license": "MIT"
},
"node_modules/@types/chai-as-promised": {
"version": "7.1.8",
"resolved": "https://registry.npmjs.org/@types/chai-as-promised/-/chai-as-promised-7.1.8.tgz",
"integrity": "sha512-ThlRVIJhr69FLlh6IctTXFkmhtP3NpMZ2QGq69StYLyKZFp/HOp1VdKZj7RvfNWYYcJ1xlbLGLLWj1UvP5u/Gw==",
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/@types/chai-as-promised/-/chai-as-promised-8.0.1.tgz",
"integrity": "sha512-dAlDhLjJlABwAVYObo9TPWYTRg9NaQM5CXeaeJYcYAkvzUf0JRLIiog88ao2Wqy/20WUnhbbUZcgvngEbJ3YXQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/chai": "*"
}
@ -2811,6 +2814,7 @@
"resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz",
"integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==",
"dev": true,
"license": "MIT",
"engines": {
"node": "*"
}
@ -3475,41 +3479,55 @@
"dev": true
},
"node_modules/chai": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/chai/-/chai-4.3.4.tgz",
"integrity": "sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA==",
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz",
"integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==",
"dev": true,
"license": "MIT",
"dependencies": {
"assertion-error": "^1.1.0",
"check-error": "^1.0.2",
"deep-eql": "^3.0.1",
"get-func-name": "^2.0.0",
"check-error": "^1.0.3",
"deep-eql": "^4.1.3",
"get-func-name": "^2.0.2",
"loupe": "^2.3.6",
"pathval": "^1.1.1",
"type-detect": "^4.0.5"
"type-detect": "^4.1.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/chai-as-promised": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-7.1.1.tgz",
"integrity": "sha512-azL6xMoi+uxu6z4rhWQ1jbdUhOMhis2PvscD/xjLqNMkv3BPPp2JyyuTHOrf9BOosGpNQ11v6BKv/g57RXbiaA==",
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-8.0.1.tgz",
"integrity": "sha512-OIEJtOL8xxJSH8JJWbIoRjybbzR52iFuDHuF8eb+nTPD6tgXLjRqsgnUGqQfFODxYvq5QdirT0pN9dZ0+Gz6rA==",
"dev": true,
"license": "MIT",
"dependencies": {
"check-error": "^1.0.2"
"check-error": "^2.0.0"
},
"peerDependencies": {
"chai": ">= 2.1.2 < 5"
"chai": ">= 2.1.2 < 6"
}
},
"node_modules/chai-as-promised/node_modules/check-error": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz",
"integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 16"
}
},
"node_modules/chai-like": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/chai-like/-/chai-like-1.1.1.tgz",
"integrity": "sha512-VKa9z/SnhXhkT1zIjtPACFWSoWsqVoaz1Vg+ecrKo5DCKVlgL30F/pEyEvXPBOVwCgLZcWUleCM/C1okaKdTTA==",
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/chai-like/-/chai-like-1.1.3.tgz",
"integrity": "sha512-JGsxE2PBhXeXxfzkAobp8KcyVdXHa96/I/4oJf6GKtQccTugVaVD68TvPDiCUo+hBC2meR68riSeABHkn+Hyug==",
"dev": true,
"license": "MIT",
"peerDependencies": {
"chai": "2 - 4"
"chai": "2 - 5"
}
},
"node_modules/chai-things": {
@ -3518,6 +3536,16 @@
"integrity": "sha1-xVEoN4+bs5nplPAAUhUZhO1uvnA=",
"dev": true
},
"node_modules/chai/node_modules/type-detect": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz",
"integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=4"
}
},
"node_modules/chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
@ -3533,10 +3561,14 @@
}
},
"node_modules/check-error": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz",
"integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=",
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz",
"integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==",
"dev": true,
"license": "MIT",
"dependencies": {
"get-func-name": "^2.0.2"
},
"engines": {
"node": "*"
}
@ -4198,15 +4230,16 @@
}
},
"node_modules/deep-eql": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz",
"integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==",
"version": "4.1.4",
"resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz",
"integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==",
"dev": true,
"license": "MIT",
"dependencies": {
"type-detect": "^4.0.0"
},
"engines": {
"node": ">=0.12"
"node": ">=6"
}
},
"node_modules/deep-is": {
@ -6664,6 +6697,7 @@
"resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz",
"integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": "*"
}
@ -9071,6 +9105,16 @@
"loose-envify": "cli.js"
}
},
"node_modules/loupe": {
"version": "2.3.7",
"resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz",
"integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==",
"dev": true,
"license": "MIT",
"dependencies": {
"get-func-name": "^2.0.1"
}
},
"node_modules/lowercase-keys": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz",
@ -10868,6 +10912,7 @@
"resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz",
"integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": "*"
}

View File

@ -44,8 +44,8 @@
"@balena/es-version": "^1.0.3",
"@balena/lint": "^8.0.2",
"@types/bluebird": "^3.5.42",
"@types/chai": "^4.3.14",
"@types/chai-as-promised": "^7.1.8",
"@types/chai": "^4.3.20",
"@types/chai-as-promised": "^8.0.1",
"@types/chai-like": "^1.1.3",
"@types/chai-things": "0.0.38",
"@types/common-tags": "^1.8.4",
@ -74,9 +74,9 @@
"balena-request": "^13.3.1",
"blinking": "^1.0.1",
"bluebird": "^3.7.2",
"chai": "^4.3.4",
"chai-as-promised": "^7.1.1",
"chai-like": "^1.1.1",
"chai": "^4.5.0",
"chai-as-promised": "^8.0.1",
"chai-like": "^1.1.3",
"chai-things": "^0.2.0",
"chokidar": "^3.5.1",
"common-tags": "^1.8.0",

View File

@ -1,5 +1,4 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import sinonChai from 'sinon-chai';
import chaiThings from 'chai-things';
import chaiLike from 'chai-like';
@ -14,9 +13,11 @@ import chaiLike from 'chai-like';
* If unsure whether to add to global fixtures, refer to the chart above.
* Also, avoid setting global mutable variables here.
*/
export const mochaGlobalSetup = function () {
export const mochaGlobalSetup = async function () {
console.log('Setting up global fixtures for tests...');
const { default: chaiAsPromised } = await import('chai-as-promised');
/* Setup chai assertion plugins */
chai.use(chaiAsPromised);
chai.use(sinonChai);