Skip to content

Commit be734a4

Browse files
committed
Add template engine and Jest timmson#18
1 parent f74f628 commit be734a4

24 files changed

Lines changed: 5695 additions & 1356 deletions

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = {
44
"node": true,
55
"commonjs": true,
66
"es6": true,
7-
"mocha": true
7+
"jest": true
88
},
99
"extends": [
1010
"eslint:recommended"

.github/workflows/nodejs.ym_

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/nodejs.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
on: [ push ]
2+
3+
jobs:
4+
build:
5+
6+
runs-on: ubuntu-latest
7+
8+
strategy:
9+
matrix:
10+
node-version: [ 12.x ]
11+
12+
steps:
13+
- uses: actions/checkout@v1
14+
- name: Use Node.js ${{ matrix.node-version }}
15+
uses: actions/setup-node@v1
16+
with:
17+
node-version: ${{ matrix.node-version }}
18+
19+
- name: Test & Generate
20+
run: |
21+
npm i
22+
npm run lint
23+
npm test
24+
npm generate
25+
env:
26+
CI: true
27+
28+
&& cd ./quiz && npm run prod && cd ../mindmap && npm run prod
29+
30+
- name: Quiz Test & Generate
31+
run: |
32+
cd ./quiz
33+
npm i
34+
npm run prod
35+
env:
36+
CI: true
37+
38+
- name: Mindmad Test & Generate
39+
run: |
40+
cd ./mindmap
41+
npm i
42+
npm run prod
43+
env:
44+
CI: true
45+
46+
- name: Commit files
47+
run: |
48+
git config --local user.email "java-interview[bot]@users.noreply.github.com"
49+
git config --local user.name "java-interview[bot]"
50+
git add -A
51+
git diff-index --quiet HEAD || git commit -m "Generate index"
52+
53+
- name: Push changes
54+
uses: ad-m/github-push-action@master
55+
with:
56+
github_token: ${{ secrets.GITHUB_TOKEN }}
57+
branch: ${{ github.ref }}

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
*.iml
22
.idea/
3-
3+
coverage
44
node_modules/
5-
coverage.lcov
6-
.nyc_output

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@
3636
+ [Основы CSS](052-css.md)
3737
+ [Основы Javascript](053-javascript.md)
3838

39-
Проект основан на [enhorse/java-interview](https://github.com/enhorse/java-interview)
39+
Проект основан на [enhorse/java-interview](https://github.com/enhorse/java-interview).

README.md.template

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## Интеллект-карта
2+
[![mindmap](./img/mindmap.png)](./mindmap)
3+
4+
## Пройти опрос
5+
[![mindmap](./img/quiz.png)](./quiz)
6+
7+
## Оглавление
8+
{{#articles}}
9+
{{{.}}}
10+
{{/articles}}
11+
12+
Проект основан на [enhorse/java-interview](https://github.com/enhorse/java-interview).

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Promise.all(mdFilesContents.reduce((accumulator, current) => accumulator.concat(
1414

1515
if (errorResults.length > 0) {
1616
errorResults.forEach(v => logger.errorFile(v));
17-
process.exit(1);
17+
process.extest(1);
1818
}
1919

2020
transformer.transformRootFile(__dirname + "/" + "README.md", mdFilesContents);

jest.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
coverageReporters: ["lcov"],
3+
testMatch: ["**/test/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)"]
4+
};

lib/fs.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const fs = require("fs");
2-
const pr = require("./parser");
32
const extension = ".md";
43

54
class FS {

lib/logger.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ require("colors");
33
class Logger {
44

55
constructor(log) {
6-
this.log = log || console.log
6+
this.log = log || console.log;
77
}
88

99
info(text) {

0 commit comments

Comments
 (0)