Skip to content

Commit

Permalink
fix: update test
Browse files Browse the repository at this point in the history
  • Loading branch information
nmn committed Dec 21, 2024
1 parent ce9c6c2 commit a2e1e7c
Showing 1 changed file with 5 additions and 36 deletions.
41 changes: 5 additions & 36 deletions packages/babel-plugin/src/utils/__tests__/state-manager.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,44 +250,13 @@ describe('StateManager config parsing', () => {

expect(warnings).toEqual([]);
});
it('logs errors on commonJS unstable_moduleResolution without rootDir', () => {
it('commonJS unstable_moduleResolution works without rootDir', () => {
const stateManager = makeState({
unstable_moduleResolution: { type: 'commonJS' },
});
expect(stateManager.options.unstable_moduleResolution).toBeNull();
expect(warnings).toMatchInlineSnapshot(`
[
[
"[@stylexjs/babel-plugin]",
"Expected (options.unstable_moduleResolution) to be one of
- \`null\` or \`undefined\`
- one of
- an object where:
- Expected "type": to be the literal "commonJS"
- Expected "rootDir": to be a string
- Expected "themeFileExtension": to be -
- one of
- \`null\` or \`undefined\`
- a string
- {"type":"commonJS"}
- an object where:
- Expected "type": to be the literal "haste"
- Expected "themeFileExtension": to be -
- one of
- \`null\` or \`undefined\`
- a string
- {"type":"commonJS"}
- an object where:
- Expected "type": to be the literal "experimental_crossFileParsing"
- Expected "rootDir": to be a string
- Expected "themeFileExtension": to be -
- one of
- \`null\` or \`undefined\`
- a string
- {"type":"commonJS"}
But got: {"type":"commonJS"}",
],
]
`);
expect(stateManager.options.unstable_moduleResolution).not.toBeNull();
expect(stateManager.options.unstable_moduleResolution.type).toBe(
'commonJS',
);
});
});

0 comments on commit a2e1e7c

Please sign in to comment.