Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Commit 38e3c08

Browse files
ThomasThomas
authored andcommitted
post query unit test not passing
1 parent 802e424 commit 38e3c08

20 files changed

+708
-101
lines changed

.vscode/tasks.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"type": "npm",
6+
"script": "dev",
7+
"problemMatcher": [],
8+
"label": "npm: dev",
9+
"detail": "nodemon server/app",
10+
"group": {
11+
"kind": "build",
12+
"isDefault": true
13+
}
14+
}
15+
]
16+
}

server/DAO/__fixtures__/dates.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const moment = require('moment');
2+
3+
module.exports = [
4+
{
5+
value: moment().format("L"),
6+
type: "date"
7+
},
8+
9+
{
10+
value: moment().add(1, 'day').format("L"),
11+
type: "date"
12+
}
13+
]

server/DAO/__tests__/DatesDAO.test.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,18 @@
11
const DateDAOClass = require('../DatesDAO')
22
const date = new DateDAOClass()
3+
const dateFixtures = require('../__fixtures__/dates')
34
const { Dates } = require('../../models/Identifier')
45

56

67
describe('Data access getAllDates function test', () => {
7-
it.skip('should return all dates array', () => {
8+
it('should return all dates array', () => {
89
const dates = date.getAllDates()
910
expect(dates).toEqual(Dates)
1011
})
1112
})
1213

1314
describe('Data access getDate function test', () => {
14-
it.skip('should return all matching dates given named param', () => {
15-
const dateArr = [ {
16-
"value": "05/12/2021",
17-
"type": "date"
18-
},
19-
{
20-
"value": "05/13/2021",
21-
"type": "date"
22-
}]
23-
expect(date.getDate('currently')).toEqual(dateArr)
15+
it('should return all matching dates given named param', () => {
16+
expect(date.getDate('currently')).toEqual(dateFixtures)
2417
})
2518
})

server/DAO/__tests__/MealtimeDAO.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ const meal = new MealtimeDAOClass()
33
const { MealTimes } = require('../../models/Identifier')
44

55
describe('Data access getAllMealtimes function test', () => {
6-
it.skip('should return all mealtimes array', () => {
6+
it('should return all mealtimes array', () => {
77
const mealtimes = meal.getAllMealtimes()
88
expect(mealtimes).toEqual(MealTimes)
99
})
1010
})
1111

1212
describe('Data access getMealtime function test', () => {
13-
it.skip('should return all mealtimes matching given param', () => {
13+
it('should return all mealtimes matching given param', () => {
1414
const mealtimesArr = [{value: "morning", type: "mealtime"}, {value: "anytime", type: "mealtime"}]
1515
expect(meal.getMealtime("breakfast")).toEqual(mealtimesArr)
1616
})

server/DAO/__tests__/StopwordDAO.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ const stopword = new StopwordDAOClass()
44

55

66
describe('Data access getAllStopwords function test', () => {
7-
it.skip('should return all stopwords array', () => {
7+
it('should return all stopwords array', () => {
88
const stopwords = stopword.getAllStopwords()
99
expect(stopwords).toEqual(stopWordList)
1010
})
1111
})
1212

1313
describe('Data access getStopword function test', () => {
14-
it.skip('should return all stopwords matching given param ', () => {
14+
it('should return all stopwords matching given param ', () => {
1515
const stopwordsArr = [{value: 'on', type: 'stopword'}, {value: 'on', type: 'stopword'}]
1616
expect(stopword.getStopword('on')).toEqual(stopwordsArr)
1717
})
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const moment = require('moment')
2+
3+
module.exports = [
4+
{
5+
"status": "success",
6+
"data": [
7+
{
8+
"value": moment().format("L"),
9+
"names": [
10+
"today",
11+
"now",
12+
"currently"
13+
]
14+
},
15+
{
16+
"value": moment().add(-1, 'day').format("L"),
17+
"names": [
18+
"yesterday"
19+
]
20+
},
21+
{
22+
"value": moment().add(1, 'day').format("L"),
23+
"names": [
24+
"tomorrow",
25+
"currently"
26+
]
27+
}
28+
]
29+
}
30+
31+
]
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
module.exports = [
2+
{
3+
"status": "success",
4+
"data": [
5+
{
6+
"value": "morning",
7+
"names": [
8+
"morning",
9+
"breakfast",
10+
"brunch"
11+
]
12+
},
13+
{
14+
"value": "midday",
15+
"names": [
16+
"midday",
17+
"mid day",
18+
"lunch"
19+
]
20+
},
21+
{
22+
"value": "evening",
23+
"names": [
24+
"evening",
25+
"dinner",
26+
"supper"
27+
]
28+
},
29+
{
30+
"value": "anytime",
31+
"names": [
32+
"anytime",
33+
"snack",
34+
"breakfast"
35+
]
36+
}
37+
]
38+
}
39+
]
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
module.exports = [
2+
{
3+
"status": "success",
4+
"data": [
5+
{
6+
"matchedWord": "This",
7+
"type": "stopword",
8+
"value": "this"
9+
},
10+
{
11+
"matchedWord": "is",
12+
"type": "stopword",
13+
"value": "is"
14+
},
15+
{
16+
"matchedWord": "it",
17+
"type": "stopword",
18+
"value": "it"
19+
},
20+
{
21+
"matchedWord": "i",
22+
"type": "stopword",
23+
"value": "i"
24+
},
25+
{
26+
"matchedWord": "am",
27+
"type": "stopword",
28+
"value": "am"
29+
},
30+
{
31+
"matchedWord": "not",
32+
"type": "stopword",
33+
"value": "not"
34+
},
35+
{
36+
"matchedWord": "on",
37+
"type": "stopword",
38+
"value": "on"
39+
},
40+
{
41+
"matchedWord": "on",
42+
"type": "stopword",
43+
"value": "on"
44+
},
45+
{
46+
"matchedWord": "lunch",
47+
"type": "mealtime",
48+
"value": "midday"
49+
},
50+
{
51+
"matchedWord": "today",
52+
"type": "date",
53+
"value": "05/15/2021"
54+
}
55+
]
56+
}
57+
]
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
module.exports = [
2+
{
3+
"status": "success",
4+
"data": [
5+
"a",
6+
"about",
7+
"above",
8+
"after",
9+
"again",
10+
"against",
11+
"all",
12+
"am",
13+
"an",
14+
"and",
15+
"any",
16+
"are",
17+
"aren",
18+
"t",
19+
"as",
20+
"at",
21+
"be",
22+
"because",
23+
"been",
24+
"before",
25+
"being",
26+
"below",
27+
"between",
28+
"both",
29+
"but",
30+
"by",
31+
"can",
32+
"cannot",
33+
"could",
34+
"couldn",
35+
"did",
36+
"didn",
37+
"do",
38+
"does",
39+
"doesn",
40+
"doing",
41+
"don",
42+
"down",
43+
"during",
44+
"each",
45+
"few",
46+
"for",
47+
"from",
48+
"further",
49+
"had",
50+
"hadn",
51+
"has",
52+
"hasn",
53+
"have",
54+
"haven",
55+
"having",
56+
"he",
57+
"d",
58+
"ll",
59+
"s",
60+
"her",
61+
"here",
62+
"hers",
63+
"herself",
64+
"him",
65+
"himself",
66+
"his",
67+
"how",
68+
"i",
69+
"m",
70+
"ve",
71+
"if",
72+
"in",
73+
"into",
74+
"is",
75+
"isn",
76+
"it",
77+
"its",
78+
"itself",
79+
"let",
80+
"me",
81+
"more",
82+
"most",
83+
"mustn",
84+
"my",
85+
"myself",
86+
"no",
87+
"nor",
88+
"not",
89+
"of",
90+
"off",
91+
"on",
92+
"on",
93+
"once",
94+
"only",
95+
"or",
96+
"other",
97+
"ought",
98+
"our",
99+
"ours",
100+
"ourselves",
101+
"out",
102+
"over",
103+
"own",
104+
"same",
105+
"shan",
106+
"she",
107+
"should",
108+
"shouldn",
109+
"so",
110+
"some",
111+
"such",
112+
"than",
113+
"that",
114+
"the",
115+
"their",
116+
"theirs",
117+
"them",
118+
"themselves",
119+
"then",
120+
"there",
121+
"these",
122+
"they",
123+
"re",
124+
"this",
125+
"those",
126+
"through",
127+
"to",
128+
"too",
129+
"under",
130+
"until",
131+
"up",
132+
"very",
133+
"was",
134+
"wasn",
135+
"we",
136+
"were",
137+
"weren",
138+
"what",
139+
"when",
140+
"where",
141+
"which",
142+
"while",
143+
"who",
144+
"whom",
145+
"why",
146+
"with",
147+
"won",
148+
"would",
149+
"wouldn",
150+
"you",
151+
"your",
152+
"yours",
153+
"yourself",
154+
"yourselves"
155+
]
156+
}
157+
]

0 commit comments

Comments
 (0)