Skip to content

Commit

Permalink
try to fix fs mock for wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Feb 21, 2025
1 parent e2d13df commit 20955f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,6 @@ jobs:
matrix.cache-key
}}
- run: ls /home/runner/work/renovate/renovate/node_modules/.pnpm/@trim21+rattler@0.1.8/node_modules/@trim21/rattler/dist/ -ahl
- run: stat /home/runner/work/renovate/renovate/node_modules/.pnpm/@trim21+rattler@0.1.8/node_modules/@trim21/rattler/dist/js_rattler_bg.wasm

- run: pnpm i

- name: Unit tests
shell: bash
run: |
Expand Down
11 changes: 5 additions & 6 deletions __mocks__/fs.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import { readFileSync } from 'fs';
import { fs } from 'memfs';


module.exports = {
...fs,
readFileSync(path,options){
if (typeof path === 'string'){
if(path.endsWith(".wasm")){
return readFileSync(path,options)
readFileSync(path, options) {
if (typeof path === 'string') {
if (path.endsWith('.wasm')) {
return readFileSync(path, options);
}
}

return fs.readFileSync(path,options)
return fs.readFileSync(path, options);
},
};

0 comments on commit 20955f9

Please sign in to comment.