Skip to content

Commit ad165a8

Browse files
Allow skipping tests (#62)
1 parent 01b1fb6 commit ad165a8

File tree

17 files changed

+438
-9
lines changed

17 files changed

+438
-9
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,8 @@ yarn-error.log
1919
/out
2020
/production_node_modules
2121
/package.template.json
22+
23+
# Fixture development files
24+
/test/fixtures/**/node_modules
25+
/test/fixtures/**/package-lock.json
26+
/test/fixtures/**/results.json

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 2.5.0
4+
5+
- Allow skipping/pending tests (`test.skip`)
6+
37
## 2.4.0
48

59
- Update dependencies

bin/prepare.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
test_file="$1$2"
66
test_file=${test_file//$'\r'}
77

8+
abs_file=$(realpath $test_file)
89

9-
if test -f "$test_file"; then
10+
if test -f "$abs_file"; then
1011
# Change xtest to test so all tests are run
1112
if [[ "$OSTYPE" == "darwin"* ]]; then # Mac OS X
1213
# BSD sed -i takes an extra parameter to specify the backup file extension

bin/run.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,17 @@ SETUP="$ROOT/dist/jest/setup.js"
8383

8484
if test -f "$REPORTER"; then
8585
echo "Using reporter : $REPORTER"
86-
echo "Using test root: $INPUT -> $OUTPUT"
87-
echo "Using runner root: $ROOT"
88-
echo "Using runner setup: $SETUP"
86+
echo "Using test-root: $INPUT"
87+
echo "Using base-root: $ROOT"
88+
echo "Using setup-env: $SETUP"
8989

9090
echo ""
9191
else
9292
>&2 echo "Expected reporter.js to exist. Did you forget to yarn build first?"
9393
>&2 echo "Using reporter : $REPORTER"
94-
>&2 echo "Using test root: $INPUT -> $OUTPUT"
95-
>&2 echo "Using runner root: $ROOT"
96-
>&2 echo "Using runner setup: $SETUP"
94+
>&2 echo "Using test-root: $INPUT"
95+
>&2 echo "Using base-root: $ROOT"
96+
>&2 echo "Using setup-env: $SETUP"
9797
>&2 echo ""
9898
>&2 echo "The following files exist in the dist folder (build output):"
9999
>&2 echo $(ls $ROOT/dist)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@exercism/javascript-test-runner",
33
"description": "Automated Test runner for exercism solutions in Javascript.",
44
"author": "Derk-Jan Karrenbeld <[email protected]>",
5-
"version": "2.4.0",
5+
"version": "2.5.0",
66
"license": "AGPL-3.0-or-later",
77
"repository": {
88
"type": "git",

src/output.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ export class Output {
5151
this.results.status =
5252
aggregatedResults.numRuntimeErrorTestSuites === 0 &&
5353
aggregatedResults.numFailedTestSuites === 0 &&
54-
aggregatedResults.numPendingTests === 0 &&
54+
// Pending tests are skipped tests. test.skip tests are fine in our
55+
// reporter and should not be forced to have ran here. So the next
56+
// line is commented out.
57+
//
58+
// aggregatedResults.numPendingTests === 0 &&
5559
aggregatedResults.numFailedTests === 0
5660
? 'pass'
5761
: 'fail'
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Instructions
2+
3+
A Pythagorean triplet is a set of three natural numbers, {a, b, c}, for
4+
which,
5+
6+
```text
7+
a**2 + b**2 = c**2
8+
```
9+
10+
and such that,
11+
12+
```text
13+
a < b < c
14+
```
15+
16+
For example,
17+
18+
```text
19+
3**2 + 4**2 = 9 + 16 = 25 = 5**2.
20+
```
21+
22+
Given an input integer N, find all Pythagorean triplets for which `a + b + c = N`.
23+
24+
For example, with N = 1000, there is exactly one Pythagorean triplet for which `a + b + c = 1000`: `{200, 375, 425}`.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
!.meta
2+
3+
# Protected or generated
4+
.git
5+
.vscode
6+
7+
# When using npm
8+
node_modules/*
9+
10+
# Configuration files
11+
babel.config.js
12+
jest.config.js
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"root": true,
3+
"extends": "@exercism/eslint-config-javascript",
4+
"env": {
5+
"jest": true
6+
},
7+
"overrides": [
8+
{
9+
"files": [".meta/proof.ci.js", ".meta/exemplar.js", "*.spec.js"],
10+
"excludedFiles": ["custom.spec.js"],
11+
"extends": "@exercism/eslint-config-javascript/maintainers"
12+
}
13+
]
14+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"blurb": "There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product a * b * c.",
3+
"authors": ["matthewmorgan"],
4+
"contributors": [
5+
"ankorGH",
6+
"rchavarria",
7+
"ryanplusplus",
8+
"SleeplessByte",
9+
"tejasbubane",
10+
"xarxziux"
11+
],
12+
"files": {
13+
"solution": ["pythagorean-triplet.js"],
14+
"test": ["pythagorean-triplet.spec.js"],
15+
"example": [".meta/proof.ci.js"]
16+
},
17+
"source": "Problem 9 at Project Euler",
18+
"source_url": "http://projecteuler.net/problem=9"
19+
}

0 commit comments

Comments
 (0)