質問編集履歴
1
不要な記載を削除
test
CHANGED
File without changes
|
test
CHANGED
@@ -98,20 +98,12 @@
|
|
98
98
|
|
99
99
|
import { apiGetRequest } from '../../lib/request_utils'
|
100
100
|
|
101
|
-
import { BASE_URL } from '../../lib/constants'
|
102
|
-
|
103
101
|
import { insertData, destroy, setup } from '../../lib/db'
|
104
102
|
|
105
103
|
|
106
104
|
|
107
|
-
const URL = BASE_URL + '/v1/sample/'
|
108
|
-
|
109
|
-
|
110
|
-
|
111
105
|
describe('test', function() {
|
112
106
|
|
113
|
-
// マスターデータ以外を削除
|
114
|
-
|
115
107
|
before(async () => {
|
116
108
|
|
117
109
|
await destroy()
|
@@ -120,8 +112,6 @@
|
|
120
112
|
|
121
113
|
|
122
114
|
|
123
|
-
// スーパーユーザー挿入
|
124
|
-
|
125
115
|
beforeEach(async () => {
|
126
116
|
|
127
117
|
await setup()
|
@@ -130,8 +120,6 @@
|
|
130
120
|
|
131
121
|
|
132
122
|
|
133
|
-
// マスターデータ以外を削除
|
134
|
-
|
135
123
|
afterEach(async () => {
|
136
124
|
|
137
125
|
await destroy()
|
@@ -148,9 +136,7 @@
|
|
148
136
|
|
149
137
|
|
150
138
|
|
151
|
-
const id = 1 // 対象ID
|
152
|
-
|
153
|
-
const uri = URL +
|
139
|
+
const uri = BASE_URL + 1
|
154
140
|
|
155
141
|
|
156
142
|
|
@@ -158,17 +144,7 @@
|
|
158
144
|
|
159
145
|
const response = await apiGetRequest(uri)
|
160
146
|
|
161
|
-
const body = JSON.parse(response.body)
|
162
|
-
|
163
|
-
const expectJson = await readJsonFile('sample/detail/0001_response.json')
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
assert.strictEqual(res.statusCode, 200)
|
147
|
+
assert.strictEqual(response.statusCode, 200)
|
168
|
-
|
169
|
-
// レスポンスボディの比較
|
170
|
-
|
171
|
-
assert.strictEqual(JSON.stringify(body), JSON.stringify(expectJson))
|
172
148
|
|
173
149
|
})
|
174
150
|
|