Skip to content

Commit e24a637

Browse files
add external-seed project to test default parser
1 parent ce9ece7 commit e24a637

5 files changed

Lines changed: 103 additions & 4 deletions

File tree

self/.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"README.md": true,
1818
"renovate.json": true,
1919
"build-x-using-y": true,
20-
"learn-freecodecamp-os": false
20+
"learn-freecodecamp-os": true,
21+
"external-seed": false
2122
},
2223
"terminal.integrated.defaultProfile.linux": "bash",
2324
"terminal.integrated.profiles.linux": {

self/config/projects.json

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
"runTestsOnWatch": true,
99
"seedEveryLesson": false,
1010
"isResetEnabled": true,
11+
"numberofLessons": null,
12+
"blockingTests": null,
13+
"breakOnFailure": null,
1114
"numberOfLessons": 27
1215
},
1316
{
@@ -16,8 +19,26 @@
1619
"isIntegrated": true,
1720
"isPublic": true,
1821
"currentLesson": 0,
19-
"numberOfLessons": 1,
22+
"runTestsOnWatch": null,
23+
"seedEveryLesson": null,
24+
"isResetEnabled": null,
25+
"numberofLessons": null,
2026
"blockingTests": true,
21-
"breakOnFailure": false
27+
"breakOnFailure": false,
28+
"numberOfLessons": 1
29+
},
30+
{
31+
"id": 2,
32+
"dashedName": "external-seed",
33+
"isIntegrated": false,
34+
"isPublic": true,
35+
"currentLesson": 0,
36+
"runTestsOnWatch": false,
37+
"seedEveryLesson": true,
38+
"isResetEnabled": true,
39+
"numberofLessons": null,
40+
"blockingTests": false,
41+
"breakOnFailure": false,
42+
"numberOfLessons": 2
2243
}
23-
]
44+
]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## 0
2+
3+
### --seed--
4+
5+
#### --cmd--
6+
7+
```bash
8+
rm -f external-seed/index.js
9+
rm -f external-seed/log
10+
```
11+
12+
## 1
13+
14+
### --seed--
15+
16+
#### --"external-seed/index.js"--
17+
18+
```js
19+
const a = 'seeding works';
20+
console.log(a);
21+
```
22+
23+
#### --cmd--
24+
25+
```bash
26+
touch external-seed/log
27+
node external-seed/index.js > external-seed/log
28+
```
29+
30+
## --fcc-end--
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# External Seed
2+
3+
A project to test the default parser `external seed` feature.
4+
5+
## 0
6+
7+
### --description--
8+
9+
The seed for this lesson deletes any `index.js` and `log` files within the `external-seed/` directory.
10+
11+
### --tests--
12+
13+
This test should pass, if the seed worked
14+
15+
```js
16+
const { readdir } = await import('fs/promises');
17+
const dir = await readdir(join(ROOT, project.dashedName));
18+
assert.equal(
19+
dir.length,
20+
1,
21+
`"${project.dashedName}" is expected to only have the .gitkeep file.`
22+
);
23+
```
24+
25+
## 1
26+
27+
### --description--
28+
29+
There should be a `index.js` file that was created and run when the lesson loaded.
30+
31+
### --tests--
32+
33+
The `index.js` file should be seeded for you.
34+
35+
```js
36+
const { access, constants } = await import('fs/promises');
37+
await access(join(ROOT, project.dashedName, 'index.js'), constants.F_OK);
38+
```
39+
40+
The `index.js` file should be run.
41+
42+
```js
43+
const { access, constants } = await import('fs/promises');
44+
await access(join(ROOT, project.dashedName, 'log'), constants.F_OK);
45+
```
46+
47+
## --fcc-end--

self/external-seed/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)