Skip to content

Commit

Permalink
Fix mark.js and fuse.js usage in typescript files/components
Browse files Browse the repository at this point in the history
  • Loading branch information
dschmidt committed Jan 9, 2023
1 parent 5a60d59 commit cb2c929
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ public-hoist-pattern[]=owncloud-sdk

# esm modules (so we can easily transpile them via jest config)
public-hoist-pattern[]=lodash-es
public-hoist-pattern[]=mark.js
public-hoist-pattern[]=fuse.js

# @vue/component-compiler-utils
hoist-pattern[]=sass
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/config/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { compilerOptions } from '../../../vite.config'
const rootDir = path.resolve(__dirname, '../../../')

// We need to transpile these modules as they are using esm syntax
const esmModules = ['lodash-es'].map((m) => `.pnpm/${m}@.*`)
const esmModules = ['lodash-es', 'mark.js', 'fuse.js'].map((m) => `.pnpm/${m}@.*`)
process.env.TZ = 'GMT'
module.exports = {
globals: {
Expand All @@ -24,6 +24,8 @@ module.exports = {
'^@/(.*)$': '<rootDir>/$1',
'core-js': '<rootDir>/node_modules/core-js',
'^vue$': '@vue/compat',
'mark.js': '<rootDir>/node_modules/mark.js/src/vanilla.js',
'fuse.js': '<rootDir>/node_modules/fuse.js/dist/fuse.esm.js',

// HACK: workaround for https://github.com/transloadit/uppy/issues/4127
'@uppy/core': '<rootDir>tests/unit/stubs/uppy',
Expand Down

0 comments on commit cb2c929

Please sign in to comment.