-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
itamar bitton
committed
Nov 23, 2018
0 parents
commit 476db7c
Showing
14 changed files
with
11,222 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
stryker.conf.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"node": true, | ||
"mocha": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended" | ||
], | ||
"parserOptions": { | ||
"ecmaVersion": 2015, | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"indent": [ | ||
"error", | ||
4 | ||
], | ||
"quotes": [ | ||
"error", | ||
"single" | ||
], | ||
"semi": [ | ||
"error", | ||
"always" | ||
], | ||
"max-lines-per-function": [ | ||
"error", | ||
20 | ||
], | ||
"complexity": [ | ||
"error", | ||
5 | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.idea | ||
node_modules | ||
dist | ||
dist-tests | ||
.nyc_output | ||
coverage | ||
lint | ||
reports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
language: node_js | ||
|
||
node_js: | ||
- 10 | ||
- node | ||
|
||
cache: npm | ||
|
||
script: | ||
- npm install | ||
- npm run test | ||
|
||
notifications: | ||
email: | ||
recipients: | ||
- bittonit@bgu.ac.il | ||
on_failure: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Sample project | ||
|
||
* 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` | ||
* Install all libraries run: `npm install` | ||
* For code parsing, this project uses the [Esprima](http://esprima.org/) library. | ||
* See example usage in `src/js/code-analyzer.js` | ||
* Run the project: | ||
* From the command-line run: `npm start` | ||
* After the bundler is done, execute the `index.html` from your IDE (preferably `WebStorm`) | ||
* Try the parser... | ||
* For testing, this project uses the [Mocha](https://mochajs.org/) library. | ||
* From the command-line run: `npm run test` | ||
* See example test in `test/code-analyzer.test.js` | ||
* For coverage, this project uses the [nyc](https://github.com/istanbuljs/nyc) library. | ||
* From the command-line run: `npm run coverage` | ||
* Run `coverage/lcov-report/index.html` to see the html report | ||
* For linting, this project uses the [ESLint](https://eslint.org/) library. | ||
* From the command-line run: `npm run lint` | ||
* See the report file `lint/eslint-report.json` | ||
|
||
#### I/O Example | ||
|
||
The input: | ||
|
||
```javascript | ||
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 | ||
... | ... | ... | ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
|
||
<style> | ||
table { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
.textAreaWrapper { | ||
width: 100%; | ||
height: 80vh; | ||
} | ||
|
||
textarea { | ||
width: 80%; | ||
height: 95%; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<table> | ||
<tr> | ||
<td> | ||
<div> | ||
<label>Enter code here</label> | ||
</div> | ||
</td> | ||
<td> | ||
<div> | ||
<label>Parsed code here</label> | ||
</div> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<div class="textAreaWrapper"> | ||
<textarea id="codePlaceholder" title="Enter code here"></textarea> | ||
</div> | ||
</td> | ||
<td> | ||
<div class="textAreaWrapper"> | ||
<textarea id="parsedCode" title="Parse code"></textarea> | ||
</div> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<div> | ||
<button id="codeSubmissionButton">Parse code</button> | ||
</div> | ||
</td> | ||
<td> | ||
</td> | ||
</tr> | ||
</table> | ||
<div id="resultTable"> | ||
|
||
</div> | ||
<script src="dist/bundle.js"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.