コード例 #1
0
 test('does not catch failures', async () => {
   server.for(url).respond({status: 500, body: {error: 'server error'}})
   try {
     await AssignmentApi.unmuteAssignment('1201', '2301')
   } catch (e) {
     ok(e.message.includes('500'))
   }
 })
コード例 #2
0
 test('sends a PUT request', async () => {
   server.for(url).respond({status: 200, body: {}})
   await AssignmentApi.unmuteAssignment('1201', '2301')
   const request = server.receivedRequests[0]
   equal(request.method, 'PUT')
 })
コード例 #3
0
 test('sets muted status to false', async () => {
   server.for(url).respond({status: 200, body: {}})
   await AssignmentApi.unmuteAssignment('1201', '2301')
   const request = server.receivedRequests[0]
   equal(paramsFromRequest(request).status, 'false')
 })
コード例 #4
0
 test('sends a request to unmute the assignment', async () => {
   server.for(url).respond({status: 200, body: {}})
   await AssignmentApi.unmuteAssignment('1201', '2301')
   const request = server.receivedRequests[0]
   equal(pathFromRequest(request), url)
 })