✅ 1er test de la librairie
parent
42e1500bcf
commit
0fcb6bd5a3
|
@ -8,10 +8,7 @@
|
|||
"engines": {
|
||||
"node": ">=8.10.0 <10.0.0"
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1% in FR",
|
||||
"not ie < 11"
|
||||
],
|
||||
"browserslist": ["> 1% in FR", "not ie < 11"],
|
||||
"dependencies": {
|
||||
"@researchgate/react-intersection-observer": "^0.7.3",
|
||||
"classnames": "^2.2.5",
|
||||
|
@ -67,7 +64,9 @@
|
|||
"test-watch": "yarn test-common --watch",
|
||||
"test-common": "mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --include componentTestSetup.js --require mock-local-storage --require test/helpers/browser.js \"./{,!(node_modules)/**/}!(webpack).test.js\"",
|
||||
"test": "yarn test-common",
|
||||
"test-components": "mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --include componentTestSetup.js --require mock-local-storage ---require test/helpers/browser.js \"source/components/**/*.test.js\" --watch"
|
||||
"test-components": "mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --include componentTestSetup.js --require mock-local-storage ---require test/helpers/browser.js \"source/components/**/*.test.js\" --watch",
|
||||
"test-lib":
|
||||
"yarn test-common --grep 'library'"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.1.0",
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
import { expect } from 'chai'
|
||||
import evaluate from '../source/engine/index'
|
||||
import { propEq } from 'ramda'
|
||||
|
||||
describe('library', function() {
|
||||
it('should evaluate one target with no input data', function() {
|
||||
let target = 'contrat salarié . salaire . net'
|
||||
let evaluated = evaluate([target], {
|
||||
'contrat salarié': { salaire: { 'brut de base': 2300 } }
|
||||
})
|
||||
let evaluatedTarget = evaluated.targets.find(propEq('dottedName', target))
|
||||
expect(evaluatedTarget)
|
||||
.to.have.property('nodeValue')
|
||||
.to.be.within(1779, 1780)
|
||||
})
|
||||
})
|
Loading…
Reference in New Issue