Skip to content

Commit

Permalink
test(postcss-plugin): remove browserslists tests on nodev20
Browse files Browse the repository at this point in the history
  • Loading branch information
clshortfuse committed Sep 20, 2024
1 parent af3845d commit 08128ea
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions test/postcss-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,29 +123,33 @@ test('ignores rules specified in comments', async (t) => {
t.end();
});

test('info with browserslist file', (t) => {
mock({
browserslist: '# Comment\nSafari 8\nIE >= 11',
});
const [versionMajor] = process.versions.node.split('.').map(Number);

const actual = new DoIUse({}).info().browsers;
const expected = [['ie', '11'], ['safari', '8']];
if (versionMajor < 20) {
test('info with browserslist file', (t) => {
mock({
browserslist: '# Comment\nSafari 8\nIE >= 11',
});

t.same(actual, expected);
const actual = new DoIUse({}).info().browsers;
const expected = [['ie', '11'], ['safari', '8']];

mock.restore();
t.same(actual, expected);

t.end();
});
mock.restore();

t.end();
});

test('info with no browserslist file or browsers config', (t) => {
const actual = new DoIUse({}).info().browsers;
test('info with no browserslist file or browsers config', (t) => {
const actual = new DoIUse({}).info().browsers;

const expected = new DoIUse({
browsers: DoIUse.default,
}).info().browsers;
const expected = new DoIUse({
browsers: DoIUse.default,
}).info().browsers;

t.same(actual, expected);
t.same(actual, expected);

t.end();
});
t.end();
});
}

0 comments on commit 08128ea

Please sign in to comment.