@theholocron/jest-config 1.16.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/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @theholocron/jest-config
2
+
3
+ ## 1.16.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`4309ce8`](https://github.com/theholocron/configs/commit/4309ce860374743fa4a4ea781820f3875e647a46) Thanks [@iamnewton](https://github.com/iamnewton)! - Releasing more, as a test
package/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Jest Preset
2
+
3
+ A [Jest preset](https://facebook.github.io/jest/docs/en/configuration.html#preset-string) for testing code within the Galaxy.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install --save-dev @theholocron/jest-preset
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ In your project `package.json` add the following:
14
+
15
+ ```json
16
+ {
17
+ "jest": {
18
+ "displayName": "<project>",
19
+ "preset": "@theholocron/jest-config"
20
+ }
21
+ }
22
+ ```
23
+
24
+ ## How We Test
25
+
26
+ Currently we use [Jest](https://jestjs.io/) for our testing framework. There isn't much to our configuration that differs from what Jest provides out of the box with the following exceptions:
27
+
28
+ - **Coverage**: we enforce coverage collection and require that all work be covered at least 80% at this time, with negligible reduction (< 1%) of coverage per PR
29
+ - **Directory Naming**: while we do support the [same regex that Jest provides](https://jestjs.io/docs/en/configuration#testregex-string--arraystring), our convention is to co-locate all test files as close to the source as possible with the suffix of `.test` added.
package/jest-preset.js ADDED
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @see https://jestjs.io/docs/configuration
3
+ * @type {import("jest").Config}
4
+ */
5
+ export default {
6
+ collectCoverage: true,
7
+ collectCoverageFrom: [
8
+ "<rootDir>/src/**/*.{js,jsx,ts,tsx}",
9
+ "!<rootDir>/**/{__mocks__,mocks}/**",
10
+ "!<rootDir>/**/*.{mocks,mock}.js",
11
+ "!<rootDir>/**/{__stories__,stories}/**",
12
+ "!<rootDir>/**/*.{stories,story}/**",
13
+ "!<rootDir>/**/__snapshots__/**"
14
+ ],
15
+ coverageThreshold: {
16
+ global: {
17
+ statements: 80,
18
+ branches: 80,
19
+ lines: 80,
20
+ functions: 80
21
+ }
22
+ },
23
+ modulePathIgnorePatterns: [
24
+ "<rootDir>/dist/",
25
+ ],
26
+ };
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@theholocron/jest-config",
3
+ "homepage": "https://github.com/the-holocron/configs/tree/master/packages/jest-preset#readme",
4
+ "description": "A Jest preset for testing code within the Galaxy.",
5
+ "author": "Newton Koumantzelis",
6
+ "version": "1.16.0",
7
+ "main": "jest-preset.js",
8
+ "type": "module",
9
+ "repository": "https://github.com/theholocron/configs.git",
10
+ "bugs": "https://github.com/theholocron/configs/issues",
11
+ "releases": "https://github.com/theholocron/configs/releases",
12
+ "wiki": "https://github.com/theholocron/configs/wiki",
13
+ "license": "GPL-3.0",
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "dependencies": {
18
+ "jest": "29.7.0"
19
+ }
20
+ }