mirror of https://github.com/webpack/webpack.git
Add failing test.
This commit is contained in:
parent
3df96f4a78
commit
21012d4327
|
@ -190,6 +190,25 @@ describe("Compiler", () => {
|
|||
});
|
||||
});
|
||||
|
||||
it("compiles top-level await to es5", done => {
|
||||
compile(
|
||||
"./topLevelAwait1",
|
||||
{
|
||||
target: ["web", "es5"],
|
||||
experiments: {
|
||||
topLevelAwait: true
|
||||
}
|
||||
},
|
||||
(stats, files) => {
|
||||
expect(Object.keys(files)).toEqual(["/main.js"]);
|
||||
const bundle = files["/main.js"];
|
||||
expect(bundle).not.toContain("await");
|
||||
expect(bundle).not.toContain("async");
|
||||
done();
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
describe("methods", () => {
|
||||
let compiler;
|
||||
beforeEach(() => {
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
import value from './topLevelAwait2';
|
||||
|
||||
console.log(value);
|
|
@ -0,0 +1 @@
|
|||
export default await Promise.resolve(1);
|
Loading…
Reference in New Issue