Skip to content

Commit

Permalink
fix: πŸ› prevent creating duplicate jest configs
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmy-guzman committed Nov 22, 2024
1 parent 378b5d2 commit 70973da
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/configs/testing.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { testingConfig } from "./testing";

describe("testingConfig", () => {
it("should create default config w/ vitest overrides", async () => {
const [, vitest] = await testingConfig({}, false);
const [vitest] = await testingConfig({}, false);

expect(vitest?.rules).toStrictEqual(
expect.objectContaining({
Expand Down
5 changes: 0 additions & 5 deletions src/configs/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ export const testingConfig = async (
const isJest = framework === "jest" || (autoDetect && hasJest());

return [
{
files: GLOB_TESTS,
name: "jimmy.codes/testing",
...jestPlugin.configs["flat/recommended"],
},
...(isVitest
? [
{
Expand Down
10 changes: 3 additions & 7 deletions src/factory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ describe("jimmyDotCodes", () => {
jimmyDotCodes({ autoDetect: false, testing: { framework: "jest" } }),
).resolves.toStrictEqual(
expect.arrayContaining([
expect.objectContaining({ name: "jimmy.codes/testing" }),
expect.objectContaining({ name: "jimmy.codes/testing/disabled" }),
expect.objectContaining({ name: "jimmy.codes/testing/jest" }),
expect.not.objectContaining({ name: "jimmy.codes/testing/vitest" }),
Expand All @@ -78,7 +77,6 @@ describe("jimmyDotCodes", () => {
jimmyDotCodes({ autoDetect: false, testing: true }),
).resolves.toStrictEqual(
expect.arrayContaining([
expect.objectContaining({ name: "jimmy.codes/testing" }),
expect.objectContaining({ name: "jimmy.codes/testing/disabled" }),
expect.not.objectContaining({ name: "jimmy.codes/testing/jest" }),
expect.objectContaining({ name: "jimmy.codes/testing/vitest" }),
Expand All @@ -95,7 +93,6 @@ describe("jimmyDotCodes", () => {
}),
).resolves.toStrictEqual(
expect.arrayContaining([
expect.objectContaining({ name: "jimmy.codes/testing" }),
expect.objectContaining({ name: "jimmy.codes/testing/disabled" }),
expect.objectContaining({ name: "jimmy.codes/testing/jest" }),
expect.objectContaining({ name: "jimmy.codes/react" }),
Expand All @@ -118,7 +115,6 @@ describe("jimmyDotCodes", () => {
}),
).resolves.toStrictEqual(
expect.arrayContaining([
expect.objectContaining({ name: "jimmy.codes/testing" }),
expect.objectContaining({ name: "jimmy.codes/testing/disabled" }),
expect.objectContaining({ name: "jimmy.codes/testing/vitest" }),
expect.objectContaining({ name: "jimmy.codes/react" }),
Expand Down Expand Up @@ -220,7 +216,7 @@ describe("jimmyDotCodes", () => {
await expect(jimmyDotCodes({ autoDetect: true })).resolves.toStrictEqual(
expect.arrayContaining([
expect.not.objectContaining({ name: "jimmy.codes/typescript" }),
expect.objectContaining({ name: "jimmy.codes/testing" }),

expect.objectContaining({ name: "jimmy.codes/testing/vitest" }),
expect.not.objectContaining({ name: "jimmy.codes/testing/jest" }),
expect.not.objectContaining({ name: "jimmy.codes/react" }),
Expand All @@ -240,7 +236,7 @@ describe("jimmyDotCodes", () => {
await expect(jimmyDotCodes({ autoDetect: true })).resolves.toStrictEqual(
expect.arrayContaining([
expect.not.objectContaining({ name: "jimmy.codes/typescript" }),
expect.objectContaining({ name: "jimmy.codes/testing" }),

expect.not.objectContaining({ name: "jimmy.codes/testing/vitest" }),
expect.objectContaining({ name: "jimmy.codes/testing/jest" }),
expect.not.objectContaining({ name: "jimmy.codes/react" }),
Expand All @@ -261,7 +257,7 @@ describe("jimmyDotCodes", () => {
await expect(jimmyDotCodes({ autoDetect: true })).resolves.toStrictEqual(
expect.arrayContaining([
expect.not.objectContaining({ name: "jimmy.codes/typescript" }),
expect.objectContaining({ name: "jimmy.codes/testing" }),

expect.objectContaining({ name: "jimmy.codes/testing/vitest" }),
expect.not.objectContaining({ name: "jimmy.codes/testing/jest" }),
expect.not.objectContaining({ name: "jimmy.codes/react" }),
Expand Down

0 comments on commit 70973da

Please sign in to comment.