This repository has been archived by the owner on Apr 28, 2021. It is now read-only.
forked from turingschool-examples/first-unit-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions-test.js
109 lines (79 loc) · 2.75 KB
/
functions-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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// functions-test.js
var assert = require('chai').assert;
var addTwoNumbers = require('./functions.js').addTwoNumbers;
var sayHello = require('./functions.js').sayHello;
var buildCar = require('./functions.js').buildCar;
describe('functions', function() {
describe('addTwoNumbers', function() {
it.skip('should be able to add zero to zero', function() {
// setup for test (if necessary)
// execute function
var result = addTwoNumbers(0, 0)
// assert what the result SHOULD be
assert.equal(result, 0)
})
it.skip('should be able to add 1 to 0', function() {
// setup for test (if necessary)
// execute function
var result = addTwoNumbers(1, 0)
// assert what the result SHOULD be
assert.equal(result, 1)
})
it.skip('should be able to add 1 to 1', function() {
// setup for test (if necessary)
// execute function
var result = addTwoNumbers(1, 1)
// assert what the result SHOULD be
assert.equal(result, 2)
})
})
describe('sayHello', function() {
it.skip('should be able to say hello to Leta', function() {
// setup for test (if necessary)
// execute function
var result = sayHello('Leta')
// assert what the result SHOULD be
assert.equal(result, 'Hi there Leta!')
})
it.skip('should be able to say hello to Casey', function() {
// setup for test (if necessary)
// execute function
var result = sayHello('Casey')
// assert what the result SHOULD be
assert.equal(result, 'Hi there Casey!')
})
it.skip('should not be able to say hello to Will', function() {
// setup for test (if necessary)
// execute function
var result = sayHello('Will')
// assert what the result SHOULD be
assert.equal(result, 'No more testing Will!')
})
})
describe('buildCar', function() {
it.skip('should return a car with a color', function() {
// setup for test (if necessary)
var color = 'red'
// execute function
var result = buildCar(color)
// assert what the result SHOULD be
assert.equal(result.color, color)
})
it.skip('should return a car with a type', function() {
// setup for test (if necessary)
var color = 'red'
var type = 'truck'
// execute function
var result = buildCar(color, type)
// assert what the result SHOULD be
assert.equal(result.type, type)
})
it.skip('should return an empty object if there are no details passed', function() {
// setup for test (if necessary)
// execute function
var result = buildCar()
// assert what the result SHOULD be
assert.deepEqual(result, {})
})
})
})