Skip to content

Commit

Permalink
Test bundled cosmiconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed May 8, 2020
1 parent ed3eeb8 commit ee6b7d1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests_integration/__tests__/third-party.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"use strict";

const path = require("path");
const { thirdParty } = require("../env");
const { cosmiconfig, cosmiconfigSync } = require(thirdParty);
const PROJECT_PRETTIERRC = path.join(__dirname, "../../.prettierrc");
const PROJECT_PRETTIER_CONFIG = {};

describe("cosmiconfig", () => {
test("async version", async () => {
const { config, filepath } = await cosmiconfig("prettier").search();
expect(config).toEqual(PROJECT_PRETTIER_CONFIG);
expect(filepath).toBe(PROJECT_PRETTIERRC);
});

test("sync version", () => {
const { config, filepath } = cosmiconfigSync("prettier").search();
expect(config).toEqual(PROJECT_PRETTIER_CONFIG);
expect(filepath).toBe(PROJECT_PRETTIERRC);
});
});

0 comments on commit ee6b7d1

Please sign in to comment.