Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:

- name: Install project dependencies
run: |
npm install -g corepack@latest
corepack enable pnpm
corepack pnpm -v
corepack pnpm install --frozen-lockfile
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr.ci.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:

- name: Install project dependencies
run: |
npm install -g corepack@latest
corepack enable pnpm
corepack pnpm -v
corepack pnpm install --frozen-lockfile
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/verify-code-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:

- name: Enable pnpm
run: |
npm install -g corepack@latest
corepack enable pnpm
corepack pnpm -v

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Changelog

## 5.0.1

## 5.0.0

- Update dependencies including core-js
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is only used by jest.runner.config.js, when running the
// test-runner. The tool itself uses typescript's compilation instead.
module.exports = {
presets: [['@exercism/babel-preset-javascript', { corejs: '3.38' }]],
presets: [['@exercism/babel-preset-javascript', { corejs: '3.43' }]],
plugins: [],
}
46 changes: 21 additions & 25 deletions bin/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ echo " 🔧 Process input arguments for run "
echo "╚═════════════════════════════════════════════════════════════╝"
echo ""

echo "✔️ Using slug : $SLUG"
echo "✔️ Using reporter : $REPORTER"
echo "✔️ Using srce-root: $INPUT"
echo "✔️ Using slug : $SLUG"
echo "✔️ Using reporter: $REPORTER"
echo "✔️ Using src-root: $INPUT"
echo "✔️ Using test-root: $OUTPUT"
echo "✔️ Using base-root: $ROOT"
echo "✔️ Using setup-env: $SETUP"
Expand Down Expand Up @@ -176,16 +176,15 @@ else
echo "The output directory is likely not placed inside the test "
echo "runner root. This means the CLI tools need configuration "
echo "files as given and understood by the test-runner for running "
echo "the tests. Will now turn the output directory into a "
echo "standalone package."
echo "the tests."
echo ""

COREPACK_ROOT_DIR="${OUTPUT}"

echo "✔️ pnpm cache from root to output"
# cd $ROOT && corepack pnpm deploy --filter @exercism/javascript-test-runner --ignore-scripts "${OUTPUT}deploy"
# mv "${OUTPUT}deploy/node_modules" "${OUTPUT}"
# cp -as "${ROOT}/node_modules/" "${OUTPUT}"
cd $ROOT && corepack pnpm deploy --filter @exercism/javascript-test-runner --ignore-scripts "${OUTPUT}deploy"
mv "${OUTPUT}deploy/node_modules" "${OUTPUT}"
cp -as "${ROOT}/node_modules/" "${OUTPUT}"
cp -r "${ROOT}/node_modules" "${OUTPUT}"

echo "✔️ .pnpm-lock.yaml from root to output"
Expand Down Expand Up @@ -312,12 +311,12 @@ if test -f "${OUTPUT}package.json"; then
ls -al "${OUTPUT}"
echo ""

if test -d "${OUTPUT}node_modules/.pnpm"; then
if test -d "${COREPACK_ROOT_DIR}node_modules/.pnpm"; then
# echo "Found .pnpm hoisted packages"
# ls -aln1 "${OUTPUT}node_modules"
# echo ""
echo "Found .pnpm hoisted binaries"
ls -al "${OUTPUT}node_modules/.bin"
ls -al "${COREPACK_ROOT_DIR}node_modules/.bin"
else
echo ".pnpm hoisted packages not found"
cd "${COREPACK_ROOT_DIR}" && corepack pnpm install --offline --frozen-lockfile
Expand Down Expand Up @@ -355,9 +354,9 @@ echo " ➤ Execution (tests: does the solution work?) "
echo "╚═════════════════════════════════════════════════════════════╝"
echo ""

echo "⚙️ corepack pnpm jest <...> --listTests"
echo "⚙️ corepack pnpm jest--listTests --passWithNoTests --detectOpenHandles --rootDir "${OUTPUT}" --config ${CONFIG}"
echo ""
jest_tests=$(cd "${COREPACK_ROOT_DIR}" && corepack pnpm jest "${OUTPUT}*" --listTests --passWithNoTests --detectOpenHandles) || false
jest_tests=$(cd "${COREPACK_ROOT_DIR}" && corepack pnpm jest --listTests --passWithNoTests --detectOpenHandles --rootDir "${OUTPUT}" --config ${CONFIG}) || false

if [ -z "${jest_tests}" ]; then
echo "❌ no jest tests (*.spec.js) discovered."
Expand Down Expand Up @@ -416,23 +415,20 @@ echo $jest_tests

# Run tests
echo ""
echo "⚙️ corepack pnpm jest <...>"
echo "⚙️ corepack pnpm jest --passWithNoTests --detectOpenHandles --rootDir "${OUTPUT}" --testLocationInResults --setupFilesAfterEnv "${SETUP}" --reporters "${REPORTER}" --outputFile="${result_file}" --noStackTrace"
echo ""

cd "${COREPACK_ROOT_DIR}" && corepack pnpm jest "${OUTPUT}*" \
--bail 1 \
--ci \
--colors \
--config ${CONFIG} \
--noStackTrace \
--outputFile="${result_file}" \
cd "${COREPACK_ROOT_DIR}" && corepack pnpm jest \
--passWithNoTests \
--reporters "${REPORTER}" \
--roots "${OUTPUT}" \
--setupFilesAfterEnv ${SETUP} \
--verbose false \
--detectOpenHandles \
--testLocationInResults
--rootDir "${OUTPUT}" \
--testLocationInResults \
--setupFilesAfterEnv "${SETUP}" \
--reporters "${REPORTER}" \
--outputFile="${result_file}" \
--noStackTrace \
--config ${CONFIG} \
--ci

# Convert exit(1) (jest worked, but there are failing tests) to exit(0)
test_exit=$?
Expand Down
2 changes: 1 addition & 1 deletion jest.runner.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = {
verbose: true,
modulePathIgnorePatterns: ['package.json'],
transform: {
'^.+\\.[t|j]sx?$': 'babel-jest',
'^.+\\.[js|cjs|mjs|jsx]$': 'babel-jest',
},
reporters: [],
}
27 changes: 14 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@exercism/javascript-test-runner",
"description": "Automated Test runner for exercism solutions in Javascript.",
"author": "Derk-Jan Karrenbeld <[email protected]>",
"version": "5.0.0",
"version": "6.0.0",
"license": "AGPL-3.0-or-later",
"repository": {
"type": "git",
Expand All @@ -27,30 +27,31 @@
"test:bare": "corepack pnpm node test/smoke.test.mjs && corepack pnpm node test/skip.test.mjs && corepack pnpm node test/log.test.mjs && corepack pnpm node test/taskid.test.mjs"
},
"dependencies": {
"@exercism/babel-preset-javascript": "^0.5.0",
"@exercism/babel-preset-javascript": "^0.6.0",
"@exercism/static-analysis": "^0.14.0",
"@jest/console": "^29.7.0",
"@jest/reporters": "^29.7.0",
"@jest/test-result": "^29.7.0",
"@jest/types": "^29.6.3",
"@typescript-eslint/typescript-estree": "^8.0.1",
"@typescript-eslint/visitor-keys": "^8.0.1",
"@typescript-eslint/typescript-estree": "^8.34.1",
"@typescript-eslint/visitor-keys": "^8.34.1",
"babel-jest": "^29.7.0",
"chalk": "^5.3.0",
"core-js": "^3.38.0",
"chalk": "^5.4.1",
"core-js": "^3.43.0",
"jest": "^29.7.0",
"shelljs": "^0.10.0"
},
"devDependencies": {
"@exercism/eslint-config-tooling": "^0.6.0",
"@babel/plugin-syntax-bigint": "^7.8.3",
"@exercism/eslint-config-tooling": "^0.9.0",
"@jest/globals": "^29.7.0",
"@tsconfig/node20": "^20.1.4",
"@types/node": "^22.1.0",
"@tsconfig/node20": "^20.1.5",
"@types/node": "^22.15.32",
"@types/shelljs": "^0.8.15",
"eslint": "^9.8.0",
"prettier": "^3.3.3",
"eslint": "^9.29.0",
"prettier": "^3.6.0",
"rimraf": "^6.0.1",
"typescript": "~5.8.3"
"typescript": "~5.7.3"
},
"packageManager": "pnpm@9.7.0+sha512.dc09430156b427f5ecfc79888899e1c39d2d690f004be70e05230b72cb173d96839587545d09429b55ac3c429c801b4dc3c0e002f653830a420fa2dd4e3cf9cf"
"packageManager": "pnpm@10.12.2"
}
Loading
Loading