Skip to content

Commit

Permalink
Add FlatConfigArray test
Browse files Browse the repository at this point in the history
  • Loading branch information
nzakas committed Jan 14, 2022
1 parent da9d3f8 commit da7f9c0
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion tests/lib/config/flat-config-array.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,24 @@ function normalizeRuleConfig(rulesConfig) {

describe("FlatConfigArray", () => {

it("should allow noniterable baseConfig objects", () => {
const base = {
languageOptions: {
parserOptions: {
foo: true
}
}
};

const configs = new FlatConfigArray([], {
basePath: __dirname,
baseConfig: base
});

// should not throw error
configs.normalizeSync();
});

it("should not reuse languageOptions.parserOptions across configs", () => {
const base = [{
languageOptions: {
Expand All @@ -165,7 +183,6 @@ describe("FlatConfigArray", () => {
assert.notStrictEqual(base[0].languageOptions.parserOptions, config.languageOptions.parserOptions, "parserOptions should be new object");
});


describe("Special configs", () => {
it("eslint:recommended is replaced with an actual config", async () => {
const configs = new FlatConfigArray(["eslint:recommended"], { basePath: __dirname });
Expand Down

0 comments on commit da7f9c0

Please sign in to comment.