Skip to content

Commit 11165f8

Browse files
committed
enable more tests
1 parent 444eb24 commit 11165f8

1 file changed

Lines changed: 13 additions & 27 deletions

File tree

test/index.test.js

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -50,31 +50,17 @@ describe('rollup-plugin-node-polyfills', function () {
5050
})
5151
})
5252

53-
// it('crypto option works (though is broken)', function (done) {
54-
// rollup
55-
// .rollup({
56-
// input: 'test/examples/crypto-broken.js',
57-
// plugins: [
58-
// nodePolyfills({
59-
// include: null,
60-
// crypto: true
61-
// })
62-
// ]
63-
// })
64-
// .then(
65-
// function () {
66-
// done(new Error('should not get here'))
67-
// },
68-
// function (err) {
69-
// if (
70-
// err.message ===
71-
// `"diffieHellman" is not exported by "\u0000polyfill-node.crypto.js", imported by "test/examples/crypto-broken.js".`
72-
// ) {
73-
// done()
74-
// return
75-
// }
76-
// done(err)
77-
// }
78-
// )
79-
// })
53+
test('crypto option works (though is broken)', async () => {
54+
let err
55+
try {
56+
const bundle = await rolldown({
57+
input: 'test/examples/crypto-broken.js',
58+
plugins: [nodePolyfills()]
59+
})
60+
const generated = await bundle.generate({ format: 'cjs' })
61+
} catch (e) {
62+
return
63+
}
64+
throw new Error('should not get here')
65+
})
8066
})

0 commit comments

Comments
 (0)