-
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
1 parent
2d94692
commit a1b8ea5
Showing
3 changed files
with
61 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
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
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,29 @@ | ||
/* | ||
* (c) William Belle, 2019. | ||
* See the LICENSE file for more details. | ||
*/ | ||
|
||
require('chai').should(); | ||
|
||
const epflMenuApi = require('../src/index.js'); | ||
|
||
describe('epfl-menu-api translateTags', function () { | ||
this.timeout(10000); | ||
|
||
it('should throw an exception with undefined', function () { | ||
(function () { | ||
epflMenuApi.translateTags(undefined); | ||
}).should.throw('Not a valid tags'); | ||
}); | ||
|
||
it('should throw an exception with ""', function () { | ||
(function () { | ||
epflMenuApi.translateTags(''); | ||
}).should.throw('Not a valid tags'); | ||
}); | ||
|
||
it('should translate tags "Poisson,Viande,Chinois,Toto"', function () { | ||
let tags = epflMenuApi.translateTags('Poisson,Viande,Chinois,Toto'); | ||
tags.should.equal('Fish,Meat,Chinese,Toto'); | ||
}); | ||
}); |