Skip to content

Commit 90e7255

Browse files
committed
chore: add IMPORT_EXPORT_REGEX test
1 parent 4913caa commit 90e7255

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

test/steps/generateChanges.test.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,26 @@ describe("steps/generateChanges", () => {
6262
`);
6363
});
6464

65+
it("matches import statements with multiple named imports", () => {
66+
const result = regex.exec(`import {
67+
package as myPackage,
68+
otherPackage,
69+
} from '../package';`);
70+
expect(result).toMatchInlineSnapshot(`
71+
[
72+
"import {
73+
package as myPackage,
74+
otherPackage,
75+
} from '../package'",
76+
"import {
77+
package as myPackage,
78+
otherPackage,
79+
} from ",
80+
"../package",
81+
]
82+
`);
83+
})
84+
6585
it("matches export * statements", () => {
6686
const result = regex.exec(`export * from 'package';`);
6787
expect(result).toMatchInlineSnapshot(`
@@ -119,6 +139,26 @@ describe("steps/generateChanges", () => {
119139
`);
120140
});
121141

142+
it("matches import statements with multiple named imports", () => {
143+
const result = regex.exec(`export {
144+
package as myPackage,
145+
otherPackage,
146+
} from '../package';`);
147+
expect(result).toMatchInlineSnapshot(`
148+
[
149+
"export {
150+
package as myPackage,
151+
otherPackage,
152+
} from '../package'",
153+
"export {
154+
package as myPackage,
155+
otherPackage,
156+
} from ",
157+
"../package",
158+
]
159+
`);
160+
})
161+
122162
it("matches require statements", () => {
123163
const result = regex.exec(`require('package');`);
124164
expect(result).toMatchInlineSnapshot(`

0 commit comments

Comments
 (0)