@patternslib/dev 3.4.1 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.md +15 -0
- package/jest/setup-tests.js +38 -0
- package/package.json +9 -9
package/CHANGES.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
## [3.5.0](https://github.com/patternslib/dev/compare/3.4.1...3.5.0) (2023-08-30)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
* **Tests:** Add helper for conditional test skipping and node version parsing. ([611b77b](https://github.com/patternslib/dev/commit/611b77b2b4469226ebcf942e5b68851e7927c630))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Maintenance
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
* Upgrade dependencies. ([1e146a9](https://github.com/patternslib/dev/commit/1e146a99047786ffbf69cc0da97763885af3736f))
|
|
19
|
+
|
|
5
20
|
## [3.4.1](https://github.com/patternslib/dev/compare/3.4.0...3.4.1) (2023-08-11)
|
|
6
21
|
|
|
7
22
|
|
package/jest/setup-tests.js
CHANGED
|
@@ -1,6 +1,44 @@
|
|
|
1
1
|
// need this for async/await in tests
|
|
2
2
|
import "regenerator-runtime/runtime";
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Return the node version.
|
|
6
|
+
*
|
|
7
|
+
* See: https://stackoverflow.com/a/20798760/1337474
|
|
8
|
+
*
|
|
9
|
+
* @returns {object} - The node version. { version, major, minor, patch }
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* global.node_version().major >= 19 // true if node version is >= 19
|
|
13
|
+
* global.node_version().version // "v14.17.0"
|
|
14
|
+
*/
|
|
15
|
+
global.node_version = () => {
|
|
16
|
+
const parsed_version = process.version.match(/^v(\d+)\.(\d+)\.(\d+)/);
|
|
17
|
+
console.log(parsed_version);
|
|
18
|
+
return {
|
|
19
|
+
version: parsed_version[0],
|
|
20
|
+
major: parseInt(parsed_version[1]),
|
|
21
|
+
minor: parseInt(parsed_version[2]),
|
|
22
|
+
patch: parseInt(parsed_version[3]),
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Conditional Jest tests
|
|
28
|
+
*
|
|
29
|
+
* See: https://stackoverflow.com/a/60438234/1337474
|
|
30
|
+
*
|
|
31
|
+
* @param {boolean} condition - The condition to test.
|
|
32
|
+
* @returns {function} - it or it.skip
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
*
|
|
36
|
+
* global.itif(global.node_version().major >= 19)("should do something", () => {
|
|
37
|
+
* // test code
|
|
38
|
+
* });
|
|
39
|
+
*/
|
|
40
|
+
global.itif = (condition) => (condition ? it : it.skip);
|
|
41
|
+
|
|
4
42
|
// pat-fullscreen
|
|
5
43
|
document.requestFullscreen = jest.fn();
|
|
6
44
|
document.exitFullscreen = jest.fn();
|
package/package.json
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternslib/dev",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"description": "Development base files for working with Patternslib and add-ons.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@babel/core": "^7.22.
|
|
8
|
-
"@babel/eslint-parser": "^7.22.
|
|
7
|
+
"@babel/core": "^7.22.11",
|
|
8
|
+
"@babel/eslint-parser": "^7.22.11",
|
|
9
9
|
"@babel/preset-env": "^7.22.10",
|
|
10
10
|
"@commitlint/cli": "^17.7.1",
|
|
11
11
|
"@commitlint/config-conventional": "^17.7.0",
|
|
12
12
|
"@release-it/conventional-changelog": "^7.0.0",
|
|
13
13
|
"babel-loader": "^9.1.3",
|
|
14
14
|
"css-loader": "^6.8.1",
|
|
15
|
-
"eslint": "^8.
|
|
15
|
+
"eslint": "^8.48.0",
|
|
16
16
|
"eslint-config-prettier": "^9.0.0",
|
|
17
17
|
"husky": "^8.0.3",
|
|
18
18
|
"identity-obj-proxy": "^3.0.0",
|
|
19
|
-
"jest": "^29.6.
|
|
20
|
-
"jest-environment-jsdom": "^29.6.
|
|
19
|
+
"jest": "^29.6.4",
|
|
20
|
+
"jest-environment-jsdom": "^29.6.4",
|
|
21
21
|
"jest-watch-typeahead": "^2.2.2",
|
|
22
|
-
"prettier": "^3.0.
|
|
22
|
+
"prettier": "^3.0.3",
|
|
23
23
|
"regenerator-runtime": "^0.14.0",
|
|
24
|
-
"release-it": "^16.1.
|
|
25
|
-
"sass": "^1.
|
|
24
|
+
"release-it": "^16.1.5",
|
|
25
|
+
"sass": "^1.66.1",
|
|
26
26
|
"sass-loader": "^13.3.2",
|
|
27
27
|
"style-loader": "^3.3.3",
|
|
28
28
|
"terser-webpack-plugin": "^5.3.9",
|