- Use this project as a template.
- Clone the project:
- Using user/password:
git clone https://github.com/aviram26/sqe-workshop-2018-sample-project.git
- Using SSH key:
git clone git@github.com:aviram26/sqe-workshop-2018-sample-project.git
- Using user/password:
- Install all libraries run:
npm install
- For code parsing, this project uses the Esprima library.
- See example usage in
src/js/code-analyzer.js
- See example usage in
- Run the project:
- From the command-line run:
npm start
- After the bundler is done, execute the
index.html
from your IDE (preferablyWebStorm
) - Try the parser...
- From the command-line run:
- For testing, this project uses the Mocha library.
- From the command-line run:
npm run test
- See example test in
test/code-analyzer.test.js
- From the command-line run:
- For coverage, this project uses the nyc library.
- From the command-line run:
npm run coverage
- Run
coverage/lcov-report/index.html
to see the html report
- From the command-line run:
- For linting, this project uses the ESLint library.
- From the command-line run:
npm run lint
- See the report file
lint/eslint-report.json
- From the command-line run:
The input:
function binarySearch(X, V, n){
let low, high, mid;
low = 0;
high = n - 1;
while (low <= high) {
mid = (low + high)/2;
if (X < V[mid])
high = mid - 1;
else if (X > V[mid])
low = mid + 1;
else
return mid;
}
return -1;
}
Should produce:
Line | Type | Name | Value |
---|---|---|---|
1 | FunctionDeclaration | binarySearch | |
1 | Param | X | |
... | ... | ... | ... |
2 | VariableDeclarator | low | 0 |
... | ... | ... | ... |