-
Notifications
You must be signed in to change notification settings - Fork 19
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
Showing
2 changed files
with
20 additions
and
15 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 |
---|---|---|
@@ -1,28 +1,28 @@ | ||
import assert from 'assert'; | ||
import wr from '../lib'; | ||
/* eslint-env node, mocha */ | ||
import wr from '../lib' | ||
import chai from 'chai' | ||
import chaiAsPromised from 'chai-as-promised' | ||
chai.use(chaiAsPromised) | ||
var expect = chai.expect | ||
|
||
describe('wordreference-api', function () { | ||
this.timeout(5000); | ||
describe('When you use a no valid word', function(){ | ||
it('Should throw an error'); | ||
}) | ||
this.timeout(5000) | ||
describe('When you use a no valid word', function () { | ||
it('Should throw an error') | ||
}) | ||
describe('When you use a no valid language', function () { | ||
it('Should throw an error'); | ||
}); | ||
it('Should throw an error') | ||
}) | ||
describe('When you use a valid word', function () { | ||
it('Should return a JSON with some properties', function (done) { | ||
expect(wr('rainbow')).to.eventually.have.property("word") | ||
expect(wr('rainbow')).to.eventually.have.property('word') | ||
.and.notify(done) | ||
}); | ||
}); | ||
}) | ||
}) | ||
describe('When you use a valid word and valid languages', function () { | ||
it('Should return a JSON with some properties', function (done) { | ||
expect(wr('rainbow')).to.eventually.have.property("word") | ||
expect(wr('rainbow')).to.eventually.have.property('word') | ||
.and.notify(done) | ||
}); | ||
}); | ||
}); | ||
}) | ||
}) | ||
}) |
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,5 @@ | ||
const wr = require('./../dist') | ||
const fs = require('fs') | ||
wr('rainbow') | ||
.then(res => fs.writeFile('index.html',JSON.stringify(res,undefined,2))) | ||
.catch(res => console.log(res)) |