Skip to content

Commit

Permalink
fix: add test for named export in fresh module
Browse files Browse the repository at this point in the history
  • Loading branch information
lachieh committed Nov 26, 2024
1 parent bd88110 commit 6aa92ae
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/docusaurus-utils/src/__tests__/moduleUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,10 @@ describe('loadFreshModule', () => {
import dependency1 from "./dependency1";
import dependency2 from "./dependency2";
export const entryValue = "entryVal1";
export default {
someEntryValue: "entryVal",
someEntryValue: "entryVal2",
dependency1,
dependency2
};
Expand All @@ -132,7 +134,8 @@ describe('loadFreshModule', () => {

// Should be able to read the initial module graph
await expect(entryFile.load()).resolves.toEqual({

Check failure on line 136 in packages/docusaurus-utils/src/__tests__/moduleUtils.test.ts

View workflow job for this annotation

GitHub Actions / Tests (20)

loadFreshModule › module graph › can load and reload fresh module graph

expect(received).resolves.toEqual(expected) // deep equality - Expected - 1 + Received + 0 @@ -1,8 +1,7 @@ Object { "dependency1": Object { - "dep1Export": "dep1 val1", "dep1Val": "dep1 val2", }, "dependency2": Object { "dep2Val": "dep2 val", }, at Object.toEqual (node_modules/expect/build/index.js:174:22) at Object.toEqual (packages/docusaurus-utils/src/__tests__/moduleUtils.test.ts:136:47)

Check failure on line 136 in packages/docusaurus-utils/src/__tests__/moduleUtils.test.ts

View workflow job for this annotation

GitHub Actions / Tests (22)

loadFreshModule › module graph › can load and reload fresh module graph

expect(received).resolves.toEqual(expected) // deep equality - Expected - 1 + Received + 0 @@ -1,8 +1,7 @@ Object { "dependency1": Object { - "dep1Export": "dep1 val1", "dep1Val": "dep1 val2", }, "dependency2": Object { "dep2Val": "dep2 val", }, at Object.toEqual (node_modules/expect/build/index.js:174:22) at Object.toEqual (packages/docusaurus-utils/src/__tests__/moduleUtils.test.ts:136:47)
someEntryValue: 'entryVal',
entryValue: 'entryVal1',
someEntryValue: 'entryVal2',
dependency1: {
dep1Export: 'dep1 val1',
dep1Val: 'dep1 val2',
Expand Down

0 comments on commit 6aa92ae

Please sign in to comment.