Skip to content

Commit

Permalink
Chore: add test for merging parserOptions in Linter (#14948)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjermanovic committed Aug 23, 2021
1 parent 3d7d5fb commit 2d18db6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/lib/linter/linter.js
Expand Up @@ -5762,4 +5762,25 @@ var a = "test2";
});
});
});

describe("merging 'parserOptions'", () => {
it("should deeply merge 'parserOptions' from an environment with 'parserOptions' from the provided config", () => {
const code = "return <div/>";
const config = {
env: {
node: true // ecmaFeatures: { globalReturn: true }
},
parserOptions: {
ecmaFeatures: {
jsx: true
}
}
};

const messages = linter.verify(code, config);

// no parsing errors
assert.strictEqual(messages.length, 0);
});
});
});

0 comments on commit 2d18db6

Please sign in to comment.