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 6bc2354
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
7 changes: 1 addition & 6 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 Expand Up @@ -705,7 +700,7 @@ jobs:
node-version: ${{ needs.setup-build.outputs.node-version }}
os: ${{ runner.os }}

- uses: sigstore/cosign-installer@d7d6bc7722e3daa8354c50bcb52f4837da5e9b6a # v3.8.1
- uses: sigstore/cosign-installer@c56c2d3e59e4281cc41dea2217323ba5694b171e # v3.8.0

- name: Docker registry login
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 6bc2354

Please sign in to comment.