Created
December 13, 2020 09:55
-
-
Save Hugo-ter-Doest/edcba0c17fae1e5fdee4409ab2044e7f to your computer and use it in GitHub Desktop.
carry_spec.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
const NodeCarry = require('../src/index.js').NodeCarry; | |
const nc = new NodeCarry(); | |
const tests = [ | |
{ | |
input: "action", | |
output: "ac" | |
}, | |
{ | |
input: "acteur", | |
output: "ac" | |
}, | |
{ | |
input: "actrices", | |
output: "ac" | |
}, | |
{ | |
input: "Dleyton", | |
output: "Dleyton" | |
}, | |
{ | |
input: "volera", | |
output: "vol" | |
}, | |
{ | |
input: "volerait", | |
output: "vol" | |
}, | |
{ | |
input: "subitement", | |
output: "subit" | |
}, | |
{ | |
input: "tempérament", | |
output: "temper" | |
}, | |
{ | |
input: "voudriez", | |
output: "voudr" | |
}, | |
{ | |
input: "vengeait", | |
output: "veng" | |
}, | |
{ | |
input: "saisissement", | |
output: "sais" | |
}, | |
{ | |
input: "transatlantique", | |
output: "transatlant" | |
}, | |
{ | |
input: "premièrement", | |
output: "premi" | |
}, | |
{ | |
input: "instruments", | |
output: "instrument" | |
}, | |
{ | |
input: "trouverions", | |
output: "trouv" | |
}, | |
{ | |
input: "publicité", | |
output: "publiqu" | |
}, | |
{ | |
input: "voyiez", | |
output: "voi" | |
}, | |
{ | |
input: "pitoyable", | |
output: "pitoi" | |
}*/ | |
] | |
describe("Carry stemmer", function() { | |
tests.forEach(test => { | |
it("stems " + test.input + " correctly", function() { | |
expect(nc.stem(test.input)).toBe(test.output); | |
}); | |
}) | |
}); |
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
$ node ../jasmine/bin/jasmine.js ./spec/carry_spec.js | |
Randomized with seed 29729 | |
Started | |
.FF..FFF.FFF...... | |
Failures: | |
1) Carry stemmer stems transatlantique correctly | |
Message: | |
Expected 'transatlantic' to be 'transatlant'. | |
Stack: | |
Error: Expected 'transatlantic' to be 'transatlant'. | |
at <Jasmine> | |
at UserContext.<anonymous> (C:\Workspace\Carry\node_modules\node-carry\spec\carry_spec.js:82:35) | |
at <Jasmine> | |
2) Carry stemmer stems publicité correctly | |
Message: | |
Expected 'public' to be 'publiqu'. | |
Stack: | |
Error: Expected 'public' to be 'publiqu'. | |
at <Jasmine> | |
at UserContext.<anonymous> (C:\Workspace\Carry\node_modules\node-carry\spec\carry_spec.js:82:35) | |
at <Jasmine> | |
3) Carry stemmer stems instruments correctly | |
Message: | |
Expected 'instrum' to be 'instrument'. | |
Stack: | |
Error: Expected 'instrum' to be 'instrument'. | |
at <Jasmine> | |
at UserContext.<anonymous> (C:\Workspace\Carry\node_modules\node-carry\spec\carry_spec.js:82:35) | |
at <Jasmine> | |
4) Carry stemmer stems premièrement correctly | |
Message: | |
Expected 'premièr' to be 'premi'. | |
Stack: | |
Error: Expected 'premièr' to be 'premi'. | |
at <Jasmine> | |
at UserContext.<anonymous> (C:\Workspace\Carry\node_modules\node-carry\spec\carry_spec.js:82:35) | |
at <Jasmine> | |
5) Carry stemmer stems pitoyable correctly | |
Message: | |
Expected 'pito' to be 'pitoi'. | |
Stack: | |
Error: Expected 'pito' to be 'pitoi'. | |
at <Jasmine> | |
at UserContext.<anonymous> (C:\Workspace\Carry\node_modules\node-carry\spec\carry_spec.js:82:35) | |
at <Jasmine> | |
6) Carry stemmer stems voyiez correctly | |
Message: | |
Expected 'voy' to be 'voi'. | |
Stack: | |
Error: Expected 'voy' to be 'voi'. | |
at <Jasmine> | |
at UserContext.<anonymous> (C:\Workspace\Carry\node_modules\node-carry\spec\carry_spec.js:82:35) | |
at <Jasmine> | |
7) Carry stemmer stems subitement correctly | |
Message: | |
Expected 'subi' to be 'subit'. | |
Stack: | |
Error: Expected 'subi' to be 'subit'. | |
at <Jasmine> | |
at UserContext.<anonymous> (C:\Workspace\Carry\node_modules\node-carry\spec\carry_spec.js:82:35) | |
at <Jasmine> | |
8) Carry stemmer stems tempérament correctly | |
Message: | |
Expected 'tempéram' to be 'temper'. | |
Stack: | |
Error: Expected 'tempéram' to be 'temper'. | |
at <Jasmine> | |
at UserContext.<anonymous> (C:\Workspace\Carry\node_modules\node-carry\spec\carry_spec.js:82:35) | |
at <Jasmine> | |
18 specs, 8 failures | |
Finished in 0.083 seconds | |
Randomized with seed 29729 (jasmine --random=true --seed=29729) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment