Skip to content

Commit 95f2a72

Browse files
committed
test: ignore errors
1 parent 29354e4 commit 95f2a72

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## main.d.ts
2+
3+
```ts
4+
export declare function foo(): number;
5+
6+
```
7+
## main.js
8+
9+
```js
10+
function foo() {
11+
return 10;
12+
}
13+
14+
export { foo };
15+
16+
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function foo() {
2+
return 10
3+
}

tests/rollup.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,4 +151,20 @@ describe.concurrent('rollup', () => {
151151

152152
await expectSnapshot(dist, `rollup/${dir}`, expect)
153153
})
154+
155+
test('ignore errors', async ({ expect }) => {
156+
const dir = 'ignore-errors'
157+
const input = path.resolve(fixtures, dir, 'main.ts')
158+
const dist = path.resolve(TEST_SANDBOX_FOLDER, dir)
159+
160+
const bundle = await rollup({
161+
input,
162+
plugins: [UnpluginIsolatedDecl({ ignoreErrors: true }), esbuild()],
163+
logLevel: 'silent',
164+
})
165+
166+
await bundle.write({ dir: dist })
167+
168+
await expectSnapshot(dist, `rollup/${dir}`, expect)
169+
})
154170
})

0 commit comments

Comments
 (0)