Skip to content

Commit

Permalink
test: null propagation (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
amilajack committed Jun 28, 2020
1 parent 7342732 commit 3d7197c
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion test/e2e.spec.ts
Expand Up @@ -2,7 +2,8 @@ import { RuleTester } from "eslint";
import rule from "../src/rules/compat";

const ruleTester = new RuleTester({
parserOptions: { ecmaVersion: 2015, sourceType: "module" },
parserOptions: { ecmaVersion: 2020, sourceType: "module" },
parser: require.resolve("@typescript-eslint/parser"),
settings: {
lintAllEsApis: true,
},
Expand All @@ -26,6 +27,10 @@ ruleTester.run("compat", rule, {
`,
settings: { browsers: ["ExplorerMobile 10"] },
},
{
code: `window?.fetch?.('example.com')`,
settings: { browsers: ["ie 9"] },
},
{
code: `
if (Array.prototype.flat) {
Expand Down Expand Up @@ -607,6 +612,16 @@ ruleTester.run("compat", rule, {
},
],
},
// @TODO: Fix this edge case
// {
// code: `window?.fetch`,
// settings: { browsers: ["ie 9"] },
// errors: [
// {
// message: "fetch is not supported in IE 9",
// },
// ],
// },
{
code: "Object.entries({}), Object.values({})",
settings: {
Expand Down

0 comments on commit 3d7197c

Please sign in to comment.