Skip to content

Commit dd0716b

Browse files
charlespwdclaude
andcommitted
Fix CI: shims.cjs path and MatchResult resource management
- Update vitest.config.mjs to reference shims.cjs instead of shims.js - Use .use() callback pattern for MatchResult disposal in grammar.spec.ts (@ohm-js/wasm requires explicit resource management; Prettier 2.x doesn't support the `using` keyword so we use .use() instead) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 08de38d commit dd0716b

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

packages/liquid-html-parser/src/grammar.spec.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,9 @@ describe('Unit: liquidHtmlGrammar', () => {
101101
expectMatchSucceeded('<6h>').to.be.false;
102102

103103
function expectMatchSucceeded(text: string) {
104-
using match = grammar.LiquidHTML.match(text, 'Node');
105-
return expect(match.succeeded(), text);
104+
return grammar.LiquidHTML.match(text, 'Node').use((match) => {
105+
return expect(match.succeeded(), text);
106+
});
106107
}
107108
});
108109
});
@@ -129,8 +130,9 @@ describe('Unit: liquidHtmlGrammar', () => {
129130
`).to.be.true;
130131

131132
function expectMatchSucceeded(text: string) {
132-
using match = grammar.LiquidStatement.match(text.trimStart(), 'Node');
133-
return expect(match.succeeded(), text);
133+
return grammar.LiquidStatement.match(text.trimStart(), 'Node').use((match) => {
134+
return expect(match.succeeded(), text);
135+
});
134136
}
135137
});
136138
});
@@ -156,8 +158,9 @@ describe('Unit: liquidHtmlGrammar', () => {
156158
});
157159

158160
function expectMatchSucceeded(text: string) {
159-
using match = placeholderGrammars.LiquidHTML.match(text.trimStart(), 'Node');
160-
return expect(match.succeeded(), text);
161+
return placeholderGrammars.LiquidHTML.match(text.trimStart(), 'Node').use((match) => {
162+
return expect(match.succeeded(), text);
163+
});
161164
}
162165
});
163166
});

packages/prettier-plugin-liquid/vitest.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ export default defineConfig({
1313
},
1414
},
1515
globalSetup: ['./src/test/test-setup.js'],
16-
setupFiles: ['../liquid-html-parser/build/shims.js'],
16+
setupFiles: ['../liquid-html-parser/build/shims.cjs'],
1717
},
1818
});

0 commit comments

Comments
 (0)