Skip to content

Commit 2dee0da

Browse files
committed
updates test to check for let
1 parent 2d7e7e0 commit 2dee0da

File tree

2 files changed

+154
-4
lines changed

2 files changed

+154
-4
lines changed

.results.json

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
{
2+
"stats": {
3+
"suites": 4,
4+
"tests": 6,
5+
"passes": 0,
6+
"pending": 0,
7+
"failures": 6,
8+
"start": "2020-11-17T17:31:06.832Z",
9+
"end": "2020-11-17T17:31:07.553Z",
10+
"duration": 721
11+
},
12+
"tests": [
13+
{
14+
"title": "is set as Scuber",
15+
"fullTitle": "index.js companyName is set as Scuber",
16+
"duration": 0,
17+
"currentRetry": 0,
18+
"err": {
19+
"stack": "ReferenceError: companyName is not defined\n at Context.<anonymous> (test/indexTest.js:15:14)\n at processImmediate (internal/timers.js:461:21)",
20+
"message": "companyName is not defined"
21+
}
22+
},
23+
{
24+
"title": "is defined as a const",
25+
"fullTitle": "index.js companyName is defined as a const",
26+
"duration": 1,
27+
"currentRetry": 0,
28+
"err": {
29+
"message": "Expected companyName to be a const: expected '// Code your solution in this file!\\n' to match /const companyName/",
30+
"showDiff": false,
31+
"actual": "// Code your solution in this file!\n",
32+
"stack": "AssertionError: Expected companyName to be a const: expected '// Code your solution in this file!\\n' to match /const companyName/\n at Context.<anonymous> (test/indexTest.js:19:21)\n at processImmediate (internal/timers.js:461:21)"
33+
}
34+
},
35+
{
36+
"title": "is declared as equal to Chelsea",
37+
"fullTitle": "index.js mostProfitableNeighborhood is declared as equal to Chelsea",
38+
"duration": 0,
39+
"currentRetry": 0,
40+
"err": {
41+
"stack": "ReferenceError: mostProfitableNeighborhood is not defined\n at Context.<anonymous> (test/indexTest.js:25:14)\n at processImmediate (internal/timers.js:461:21)",
42+
"message": "mostProfitableNeighborhood is not defined"
43+
}
44+
},
45+
{
46+
"title": "is defined using let",
47+
"fullTitle": "index.js mostProfitableNeighborhood is defined using let",
48+
"duration": 0,
49+
"currentRetry": 0,
50+
"err": {
51+
"message": "Expected mostProfitableNeighborhood to be defined using let: expected '// Code your solution in this file!\\n' to match /let mostProfitableNeighborhood/",
52+
"showDiff": false,
53+
"actual": "// Code your solution in this file!\n",
54+
"stack": "AssertionError: Expected mostProfitableNeighborhood to be defined using let: expected '// Code your solution in this file!\\n' to match /let mostProfitableNeighborhood/\n at Context.<anonymous> (test/indexTest.js:29:21)\n at processImmediate (internal/timers.js:461:21)"
55+
}
56+
},
57+
{
58+
"title": "is declared as equal to Susan Smith",
59+
"fullTitle": "index.js companyCeo is declared as equal to Susan Smith",
60+
"duration": 1,
61+
"currentRetry": 0,
62+
"err": {
63+
"stack": "ReferenceError: companyCeo is not defined\n at Context.<anonymous> (test/indexTest.js:35:14)\n at processImmediate (internal/timers.js:461:21)",
64+
"message": "companyCeo is not defined"
65+
}
66+
},
67+
{
68+
"title": "is defined using let",
69+
"fullTitle": "index.js companyCeo is defined using let",
70+
"duration": 0,
71+
"currentRetry": 0,
72+
"err": {
73+
"message": "Expected companyCeo to be defined using let: expected '// Code your solution in this file!\\n' to match /let companyCeo/",
74+
"showDiff": false,
75+
"actual": "// Code your solution in this file!\n",
76+
"stack": "AssertionError: Expected companyCeo to be defined using let: expected '// Code your solution in this file!\\n' to match /let companyCeo/\n at Context.<anonymous> (test/indexTest.js:39:21)\n at processImmediate (internal/timers.js:461:21)"
77+
}
78+
}
79+
],
80+
"pending": [],
81+
"failures": [
82+
{
83+
"title": "is set as Scuber",
84+
"fullTitle": "index.js companyName is set as Scuber",
85+
"duration": 0,
86+
"currentRetry": 0,
87+
"err": {
88+
"stack": "ReferenceError: companyName is not defined\n at Context.<anonymous> (test/indexTest.js:15:14)\n at processImmediate (internal/timers.js:461:21)",
89+
"message": "companyName is not defined"
90+
}
91+
},
92+
{
93+
"title": "is defined as a const",
94+
"fullTitle": "index.js companyName is defined as a const",
95+
"duration": 1,
96+
"currentRetry": 0,
97+
"err": {
98+
"message": "Expected companyName to be a const: expected '// Code your solution in this file!\\n' to match /const companyName/",
99+
"showDiff": false,
100+
"actual": "// Code your solution in this file!\n",
101+
"stack": "AssertionError: Expected companyName to be a const: expected '// Code your solution in this file!\\n' to match /const companyName/\n at Context.<anonymous> (test/indexTest.js:19:21)\n at processImmediate (internal/timers.js:461:21)"
102+
}
103+
},
104+
{
105+
"title": "is declared as equal to Chelsea",
106+
"fullTitle": "index.js mostProfitableNeighborhood is declared as equal to Chelsea",
107+
"duration": 0,
108+
"currentRetry": 0,
109+
"err": {
110+
"stack": "ReferenceError: mostProfitableNeighborhood is not defined\n at Context.<anonymous> (test/indexTest.js:25:14)\n at processImmediate (internal/timers.js:461:21)",
111+
"message": "mostProfitableNeighborhood is not defined"
112+
}
113+
},
114+
{
115+
"title": "is defined using let",
116+
"fullTitle": "index.js mostProfitableNeighborhood is defined using let",
117+
"duration": 0,
118+
"currentRetry": 0,
119+
"err": {
120+
"message": "Expected mostProfitableNeighborhood to be defined using let: expected '// Code your solution in this file!\\n' to match /let mostProfitableNeighborhood/",
121+
"showDiff": false,
122+
"actual": "// Code your solution in this file!\n",
123+
"stack": "AssertionError: Expected mostProfitableNeighborhood to be defined using let: expected '// Code your solution in this file!\\n' to match /let mostProfitableNeighborhood/\n at Context.<anonymous> (test/indexTest.js:29:21)\n at processImmediate (internal/timers.js:461:21)"
124+
}
125+
},
126+
{
127+
"title": "is declared as equal to Susan Smith",
128+
"fullTitle": "index.js companyCeo is declared as equal to Susan Smith",
129+
"duration": 1,
130+
"currentRetry": 0,
131+
"err": {
132+
"stack": "ReferenceError: companyCeo is not defined\n at Context.<anonymous> (test/indexTest.js:35:14)\n at processImmediate (internal/timers.js:461:21)",
133+
"message": "companyCeo is not defined"
134+
}
135+
},
136+
{
137+
"title": "is defined using let",
138+
"fullTitle": "index.js companyCeo is defined using let",
139+
"duration": 0,
140+
"currentRetry": 0,
141+
"err": {
142+
"message": "Expected companyCeo to be defined using let: expected '// Code your solution in this file!\\n' to match /let companyCeo/",
143+
"showDiff": false,
144+
"actual": "// Code your solution in this file!\n",
145+
"stack": "AssertionError: Expected companyCeo to be defined using let: expected '// Code your solution in this file!\\n' to match /let companyCeo/\n at Context.<anonymous> (test/indexTest.js:39:21)\n at processImmediate (internal/timers.js:461:21)"
146+
}
147+
}
148+
],
149+
"passes": []
150+
}

test/indexTest.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ describe('index.js', function () {
2525
expect(mostProfitableNeighborhood).to.equal('Chelsea');
2626
});
2727

28-
it('does not raise error if the mostProfitableNeighborhood is changed', function () {
29-
expect(function () { mostProfitableNeighborhood = 'Upper West Side' }).to.not.throw(TypeError);
28+
it('is defined using let', function () {
29+
expect(js).to.match(/let mostProfitableNeighborhood/, "Expected mostProfitableNeighborhood to be defined using let");
3030
});
3131
});
3232

@@ -35,8 +35,8 @@ describe('index.js', function () {
3535
expect(companyCeo).to.equal('Susan Smith');
3636
});
3737

38-
it('does not raise error if the companyCeo is changed', function () {
39-
expect(function () { companyCeo = 'Lauren Hart' }).to.not.throw(TypeError);
38+
it('is defined using let', function () {
39+
expect(js).to.match(/let companyCeo/, "Expected companyCeo to be defined using let");
4040
});
4141
});
4242
});

0 commit comments

Comments
 (0)