Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Android time queries with mobileToDesktop (#763)
* Fix Android time queries with mobileToDesktop * Test equivalent queries for all browsers
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const { test } = require('uvu') | ||
const { equal } = require('uvu/assert') | ||
|
||
delete require.cache[require.resolve('..')] | ||
const browserslist = require('..') | ||
|
||
const MAX_VERSIONS = Number.MAX_SAFE_INTEGER | ||
const MAX_YEARS = Number.MAX_SAFE_INTEGER | ||
|
||
const allTest = opts => { | ||
const result = browserslist('since 1990', opts) | ||
equal(browserslist('last ' + MAX_VERSIONS + ' versions', opts), result) | ||
equal(browserslist('last ' + MAX_YEARS + ' years', opts), result) | ||
// Removed until mobileToDesktop works for usage queries | ||
// equal(browserslist('>= 0%, not unreleased versions', opts), result) | ||
} | ||
|
||
test('Queries for all browsers', () => { | ||
allTest() | ||
}) | ||
test('Queries for all browsers with mobile to desktop', () => { | ||
allTest({ mobileToDesktop: true }) | ||
}) | ||
|
||
test.run() |