Skip to content

Commit 0bd1725

Browse files
committed
feat: add cssStub to jest
1 parent b0275c3 commit 0bd1725

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@
145145
},
146146
"modulePathIgnorePatterns": [
147147
"<rootDir>/release"
148-
]
148+
],
149+
"moduleNameMapper": {
150+
"^.+\\.(css|less)$": "<rootDir>/test/cssStub.ts"
151+
}
149152
}
150153
}

test/cssStub.ts

Lines changed: 5 additions & 0 deletions
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)