Skip to content

Commit

Permalink
Fixup env.support for ChromeAndroid (#8447)
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic committed Sep 6, 2022
1 parent 527e477 commit 55140b6
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/core/core/src/public/Environment.js
Expand Up @@ -52,6 +52,7 @@ const ALL_BROWSERS = [
'kaios',
];

// See require("caniuse-api").getSupport(<feature name>)
const supportData = {
esmodules: {
edge: '16',
Expand Down Expand Up @@ -119,6 +120,7 @@ const supportData = {
qq: '10.4',
baidu: '7.12',
kaios: '2.5',
and_chr: '50',
and_qq: '12.12',
op_mob: '64',
},
Expand Down
27 changes: 27 additions & 0 deletions packages/core/core/test/PublicEnvironment.test.js
@@ -0,0 +1,27 @@
// @flow strict-local

import assert from 'assert';
import {createEnvironment} from '../src/Environment';
import PublicEnvironment from '../src/public/Environment';
import {DEFAULT_OPTIONS} from './test-utils';

describe('Public Environment', () => {
it('has correct support data for ChromeAndroid', () => {
let env = new PublicEnvironment(
createEnvironment({
context: 'browser',
engines: {
browsers: ['last 1 Chrome version', 'last 1 ChromeAndroid version'],
},
outputFormat: 'esmodule',
}),
DEFAULT_OPTIONS,
);

assert(env.supports('esmodules'));
assert(env.supports('dynamic-import'));
assert(env.supports('worker-module'));
assert(env.supports('import-meta-url'));
assert(env.supports('arrow-functions'));
});
});

0 comments on commit 55140b6

Please sign in to comment.