@html-validate/jest-config 3.3.3 → 3.4.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/README.md +13 -0
- package/jest-preset.js +6 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,3 +27,16 @@ In your `package.json` file:
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
```
|
|
30
|
+
|
|
31
|
+
### Importing HTML as string
|
|
32
|
+
|
|
33
|
+
Importing `*.html` is supported by jest configuration but requires additional typescript config by creating a declaration:
|
|
34
|
+
|
|
35
|
+
`shim-html.d.ts`:
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
declare module "*.html" {
|
|
39
|
+
const value: string;
|
|
40
|
+
export default value;
|
|
41
|
+
}
|
|
42
|
+
```
|
package/jest-preset.js
CHANGED
|
@@ -12,6 +12,11 @@ module.exports = {
|
|
|
12
12
|
"!**/generated/**",
|
|
13
13
|
],
|
|
14
14
|
coverageReporters: ["text", "text-summary", "cobertura", "html", "json", "lcov"],
|
|
15
|
+
globals: {
|
|
16
|
+
"ts-jest": {
|
|
17
|
+
stringifyContentPathRegex: "\\.html?$",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
15
20
|
reporters: [
|
|
16
21
|
"default",
|
|
17
22
|
[
|
|
@@ -29,6 +34,7 @@ module.exports = {
|
|
|
29
34
|
snapshotSerializers: [require.resolve("./dist/convert-ansi")],
|
|
30
35
|
transform: {
|
|
31
36
|
"^.+\\.tsx?$": require.resolve("ts-jest"),
|
|
37
|
+
"^.+\\.html?$": require.resolve("ts-jest"),
|
|
32
38
|
},
|
|
33
39
|
testPathIgnorePatterns: [
|
|
34
40
|
"/node_modules/",
|