Skip to content

Commit

Permalink
Merge pull request #2303 from tmsns/fix/lru-size
Browse files Browse the repository at this point in the history
fix(@web/test-runner-coverage-v8): ensure the size of source files is calculcated correctly when caching them
  • Loading branch information
thepassle authored Jun 15, 2023
2 parents 9c15476 + 8040495 commit d6af3e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/silent-hats-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@web/test-runner-coverage-v8': patch
---

fix: ensure the size of source files is calculcated correctly when caching them
1 change: 1 addition & 0 deletions packages/test-runner-coverage-v8/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const cachedMatchers = new Map<string, Matcher>();
// them from disk per call
const cachedSources = new LruCache<string, IstanbulSource>({
maxSize: 1024 * 1024 * 50,
sizeCalculation: n => n.source.length,
});

// coverage base dir must be separated with "/"
Expand Down

0 comments on commit d6af3e0

Please sign in to comment.