未捕获的断言错误预期未定义等于'ken'

时间:2018-11-28 10:04:40

标签: node.js mocha chai supertest

我正在尝试对我的api端点“更新”运行摩卡测试,但是会引发错误。 我安装了摩卡,柴和超级测试。 我想念什么吗?

const chai = require('chai');
const { assert } = require('chai');
const chaiHttp = require('chai-http');
const { expect } = require('chai');
const supertest = require('supertest');
const App = require('../app');

api = supertest('http://localhost:5000');

describe('UPDATE / redflag record', () => {
it('should be updated with a new name', (done) => {
api.put('/api/v1/admin/redflag/1')
.set('Accept', 'application/x-www-form-urlencoded')
.send({
status: "ken",
})
.expect(200)
.end((err, res) => {
expect(res.body.status).to.equal("ken");
done();
});
});
});

0 个答案:

没有答案