Skip to content

Commit a582c13

Browse files
committed
add a convenient method to run tests with npm scripts, fix a typo and add a gitignore file
1 parent ec660ac commit a582c13

File tree

6 files changed

+79
-2
lines changed

6 files changed

+79
-2
lines changed

.gitignore

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
### Node ###
2+
# Logs
3+
logs
4+
*.log
5+
npm-debug.log*
6+
yarn-debug.log*
7+
yarn-error.log*
8+
lerna-debug.log*
9+
10+
# Diagnostic reports (https://nodejs.org/api/report.html)
11+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12+
13+
# Runtime data
14+
pids
15+
*.pid
16+
*.seed
17+
*.pid.lock
18+
19+
# Directory for instrumented libs generated by jscoverage/JSCover
20+
lib-cov
21+
22+
# Coverage directory used by tools like istanbul
23+
coverage
24+
*.lcov
25+
26+
# Dependency directories
27+
node_modules/
28+
jspm_packages/
29+
30+
# Optional npm cache directory
31+
.npm
32+
33+
# Optional REPL history
34+
.node_repl_history
35+
36+
# Output of 'npm pack'
37+
*.tgz
38+
39+
# Yarn Integrity file
40+
.yarn-integrity
41+
42+
# dotenv environment variables file
43+
.env
44+
.env.test
45+
.env*.local
46+
47+
# parcel-bundler cache (https://parceljs.org/)
48+
.cache
49+
.parcel-cache
50+
51+
# Stores VSCode versions used for testing VSCode extensions
52+
.vscode-test
53+
54+
# Temporary folders
55+
tmp/
56+
temp/
57+
58+
#Jetbrains IDEs
59+
/.idea

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
# jsnation-regex-workshop
22

33
Code for the [JSNation Live](https://live.jsnation.com/workshops-3h) Regular Expressions workshop, June 14, 2021
4+
5+
### How to run tests ?
6+
7+
- You can simply run
8+
```shell
9+
# just pass the number of the file name with the file parameter
10+
npm run test --file=1
11+
# notice you don't have to write the whole file name
12+
# just lecture number is enough for example for the 4th test;
13+
npm run test --file=4
14+
```
15+

exercises/1-regexp-methods.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ assert(hasQWord("This exquisite string has no matching words.") === false);
1616
// followed by a space, newline, punctuation, etc.
1717
const findFirstWord = (inputString) => {
1818
const regex = /^\W*(\w+)\b/;
19-
// write funtion here
19+
// write function here
2020
};
2121
assert.strictEqual(
2222
findFirstWord("I, a JavaScript fan, am at the JSNation regex workshop!"),

exercises/2-string-methods.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const assert = require("assert");
66
// Note: later we will do this same exercise using string splitting.
77
const getPunchline = (joke) => {
88
const regex = /[^\?]\?\s*(.+)/;
9+
// write function here
910
};
1011

1112
const joke1 =

package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Code for the JSNation Live Regular Expressions workshop, June 14, 2021",
55
"directories": {},
66
"scripts": {
7-
"test": "node exercises/$1*.js"
7+
"test": "node exercises/$npm_config_file*.js"
88
},
99
"repository": {
1010
"type": "git",

0 commit comments

Comments
 (0)