| 1 | import presetModern from ".."; |
| 2 | |
| 3 | describe("@babel/preset-modern", () => { |
| 4 | describe("smoke test", () => { |
| 5 | it("should assert Babel 7", () => { |
| 6 | expect(presetModern).toEqual(expect.any(Function)); |
| 7 | const assertVersion = jest.fn(); |
| 8 | presetModern( |
| 9 | { |
| 10 | assertVersion, |
| 11 | }, |
| 12 | {} |
| 13 | ); |
| 14 | expect(assertVersion).toHaveBeenCalledWith(7); |
| 15 | }); |
| 16 | |
| 17 | it("should return a configuration object with plugins", () => { |
| 18 | expect(presetModern).toEqual(expect.any(Function)); |
| 19 | const preset = presetModern( |
| 20 | { |
| 21 | assertVersion() {}, |
| 22 | }, |
| 23 | {} |
| 24 | ); |
| 25 | expect(preset).toHaveProperty("plugins"); |
| 26 | expect(preset.plugins).toEqual(expect.any(Array)); |
| 27 | }); |
| 28 | }); |
| 29 | }); |