Skip to content

Commit 28b440a

Browse files
committed
feat: add cssStub to jest
1 parent 4f1f2c7 commit 28b440a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@
153153
"<rootDir>/release-npm-package",
154154
"<rootDir>/release-gcp",
155155
"<rootDir>/release-images"
156-
]
156+
],
157+
"moduleNameMapper": {
158+
"^.+\\.(css|less)$": "<rootDir>/test/cssStub.ts"
159+
}
157160
}
158161
}

test/cssStub.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Note: this is needed for the register.test.ts
2+
// This is because inside src/browser/register.ts
3+
// we import CSS files, which Jest can't handle unless we tell it how to
4+
// See: https://stackoverflow.com/a/39434579/3015595
5+
module.exports = {}

0 commit comments

Comments
 (0)