| 1 |
import { fileURLToPath } from "url"; |
| 2 |
import path from "path"; |
| 3 |
|
| 4 |
import _getTargets from "../../lib/index.js"; |
| 5 |
const getTargets = _getTargets.default || _getTargets; |
| 6 |
|
| 7 |
const oldCwd = process.cwd(); |
| 8 |
|
| 9 |
beforeAll(() => { |
| 10 |
process.chdir(path.dirname(fileURLToPath(import.meta.url))); |
| 11 |
}); |
| 12 |
|
| 13 |
afterAll(() => { |
| 14 |
process.chdir(oldCwd); |
| 15 |
}); |
| 16 |
|
| 17 |
it("loads packageJson.browserslist", () => { |
| 18 |
const actual = getTargets({}, {}); |
| 19 |
|
| 20 |
expect(actual).toEqual({ chrome: "4.0.0" }); |
| 21 |
}); |