https://github.com/fakiolinho/js-browser-tdd
Setup a fast TDD env on browser with mocha and chai.
https://github.com/fakiolinho/js-browser-tdd
chai javascript mocha
Last synced: about 1 month ago
JSON representation
Setup a fast TDD env on browser with mocha and chai.
- Host: GitHub
- URL: https://github.com/fakiolinho/js-browser-tdd
- Owner: fakiolinho
- Created: 2017-04-07T09:32:21.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-07T09:37:52.000Z (about 8 years ago)
- Last Synced: 2025-02-04T21:19:22.508Z (3 months ago)
- Topics: chai, javascript, mocha
- Language: HTML
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# js-browser-tdd
Setup a fast TDD env on browser with mocha and chai.
## Installation
```bash
git clone https://github.com/fakiolinho/js-browser-tdd.git
npm i && npm start
```## Tested Method
Function to test if a number is prime:
```javascript
function isPrime(x) {
if (! Number.isInteger(x)) {
return false;
}
if (x < 2) {
return false;
}
for (let i = 2; i <= Math.sqrt(x); i++) {
if (x % i === 0) {
return false;
}
}
return true;
}
```