Skip to content

Commit

Permalink
chore(publish): fix failing tests on windows os (#3627)
Browse files Browse the repository at this point in the history
  • Loading branch information
amorscher committed May 3, 2023
1 parent 1e68118 commit 0e1d349
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
# Ignored specs currently failing on windows
# TODO: investigate why
npx nx run-many -t test --parallel=3 --ci --maxWorkers=2 --testTimeout=60000 --testPathIgnorePatterns=import-command.spec.ts --testPathIgnorePatterns=publish-command.spec.ts --testPathIgnorePatterns=publish-licenses.spec.ts --testPathIgnorePatterns=publish-lifecycle-scripts.spec.ts --testPathIgnorePatterns=publish-tagging.spec.ts --testPathIgnorePatterns=publish-relative-file-specifiers.spec.ts &
npx nx run-many -t test --parallel=3 --ci --maxWorkers=2 --testTimeout=60000 --testPathIgnorePatterns=import-command.spec.ts &
pids+=($!)
Expand Down
6 changes: 6 additions & 0 deletions libs/commands/publish/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import { pathsToModuleNameMapper } from "ts-jest";
import fs from "fs";

const compilerOptions = JSON.parse(fs.readFileSync("tsconfig.base.json", "utf8")).compilerOptions;
/* eslint-disable */
export default {
displayName: "commands-publish",
Expand All @@ -6,4 +10,6 @@ export default {
// Needed to add "json" to avoid issue resolving spdx-license-ids
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json"],
testTimeout: 45e3,
//to have all paths available for mocking
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: "<rootDir>/../../../" }),
};
4 changes: 2 additions & 2 deletions libs/commands/publish/src/lib/publish-licenses.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ setupLernaVersionMocks();
const packDirectory = _packDirectory as any;

// eslint-disable-next-line @typescript-eslint/no-var-requires
const { createTempLicenses } = require("../src/lib/create-temp-licenses");
const { createTempLicenses } = require("./create-temp-licenses");
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { removeTempLicenses } = require("../src/lib/remove-temp-licenses");
const { removeTempLicenses } = require("./remove-temp-licenses");

const initFixture = initFixtureFactory(__dirname);

Expand Down

0 comments on commit 0e1d349

Please sign in to comment.