-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathobjectDecider.test.js
27 lines (25 loc) · 1.03 KB
/
objectDecider.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
jest.setTimeout(30000)
const objectDecider = require('./../lib/objectDecider')
let decision
describe('object decider', function() {
test('should return true if content seems ok', async function() {
decision = objectDecider.objectDecider('Burger, salad, coke')
expect(decision).toBe(true)
})
test('should return false if content seems not ok', async function() {
decision = objectDecider.objectDecider(null)
expect(decision).toBe(false)
})
test('should return false if content seems not ok', async function() {
decision = objectDecider.objectDecider('• Daily menu: ♪"No Milk Today"♫')
expect(decision).toBe(false)
})
test('should return false if content is out-of-date', async function() {
decision = objectDecider.objectDecider('• Daily menu is outdated!')
expect(decision).toBe(false)
})
test('should return false if content is out-of-date (variation no.2)', async function() {
decision = objectDecider.objectDecider('• Daily menu is out of date!')
expect(decision).toBe(false)
})
})