mirror of
https://github.com/suitenumerique/drive.git
synced 2026-08-17 20:15:40 +02:00
✅(frontend) mock saxen in jest config
ui-kit 0.28.0 pulls in read-excel-file, whose CommonJS build requires saxen, an ESM-only package that jest cannot parse. No unit test parses spreadsheets, so a stub parser is enough, following the pretty-bytes precedent.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
// saxen is ESM-only, which Jest cannot parse from read-excel-file's CJS
|
||||
// build (pulled in by ui-kit). No unit test parses spreadsheets, so a
|
||||
// stub Parser is enough.
|
||||
module.exports = {
|
||||
Parser: class Parser {
|
||||
on() {}
|
||||
parse() {}
|
||||
stop() {}
|
||||
},
|
||||
};
|
||||
@@ -12,6 +12,7 @@ const config: Config = {
|
||||
"\\.(css|less|scss|sass|svg|png|jpg|jpeg|gif)$":
|
||||
"<rootDir>/__mocks__/fileMock.js",
|
||||
"^pretty-bytes$": "<rootDir>/__mocks__/pretty-bytes.js",
|
||||
"^saxen$": "<rootDir>/__mocks__/saxen.js",
|
||||
// Then handle path aliases
|
||||
...pathsToModuleNameMapper(tsconfig.compilerOptions.paths || {}, {
|
||||
prefix: "<rootDir>/",
|
||||
|
||||
Reference in New Issue
Block a user