Skip to content

Commit

Permalink
add external-seed project to test default parser
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaunSHamilton committed Feb 12, 2024
1 parent ce9ece7 commit e24a637
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 4 deletions.
3 changes: 2 additions & 1 deletion self/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"README.md": true,
"renovate.json": true,
"build-x-using-y": true,
"learn-freecodecamp-os": false
"learn-freecodecamp-os": true,
"external-seed": false
},
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.profiles.linux": {
Expand Down
27 changes: 24 additions & 3 deletions self/config/projects.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"runTestsOnWatch": true,
"seedEveryLesson": false,
"isResetEnabled": true,
"numberofLessons": null,
"blockingTests": null,
"breakOnFailure": null,
"numberOfLessons": 27
},
{
Expand All @@ -16,8 +19,26 @@
"isIntegrated": true,
"isPublic": true,
"currentLesson": 0,
"numberOfLessons": 1,
"runTestsOnWatch": null,
"seedEveryLesson": null,
"isResetEnabled": null,
"numberofLessons": null,
"blockingTests": true,
"breakOnFailure": false
"breakOnFailure": false,
"numberOfLessons": 1
},
{
"id": 2,
"dashedName": "external-seed",
"isIntegrated": false,
"isPublic": true,
"currentLesson": 0,
"runTestsOnWatch": false,
"seedEveryLesson": true,
"isResetEnabled": true,
"numberofLessons": null,
"blockingTests": false,
"breakOnFailure": false,
"numberOfLessons": 2
}
]
]
30 changes: 30 additions & 0 deletions self/curriculum/locales/english/external-seed-seed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## 0

### --seed--

#### --cmd--

```bash
rm -f external-seed/index.js
rm -f external-seed/log
```

## 1

### --seed--

#### --"external-seed/index.js"--

```js
const a = 'seeding works';
console.log(a);
```

#### --cmd--

```bash
touch external-seed/log
node external-seed/index.js > external-seed/log
```

## --fcc-end--
47 changes: 47 additions & 0 deletions self/curriculum/locales/english/external-seed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# External Seed

A project to test the default parser `external seed` feature.

## 0

### --description--

The seed for this lesson deletes any `index.js` and `log` files within the `external-seed/` directory.

### --tests--

This test should pass, if the seed worked

```js
const { readdir } = await import('fs/promises');
const dir = await readdir(join(ROOT, project.dashedName));
assert.equal(
dir.length,
1,
`"${project.dashedName}" is expected to only have the .gitkeep file.`
);
```

## 1

### --description--

There should be a `index.js` file that was created and run when the lesson loaded.

### --tests--

The `index.js` file should be seeded for you.

```js
const { access, constants } = await import('fs/promises');
await access(join(ROOT, project.dashedName, 'index.js'), constants.F_OK);
```

The `index.js` file should be run.

```js
const { access, constants } = await import('fs/promises');
await access(join(ROOT, project.dashedName, 'log'), constants.F_OK);
```

## --fcc-end--
Empty file added self/external-seed/.gitkeep
Empty file.

0 comments on commit e24a637

Please sign in to comment.