-3
私は、モカ、モックゴース、チャイを使用してテストケースを作成しています。テストケースを実行している間、私はプロミスリジェクション17のエラーを処理しません。未処理の約束拒否17
UnhandledPromiseRejectionWarning:未処理の約束拒否(拒否ID:17):のmongodは
Unhandle Promise Rejection error 17
var chai = require('chai');
var chaiHttp = require('chai-http');
var should = chai.should();
var expect = require("chai").expect;
var testData = require('./testData');
var apiUrl = require('./apiUrl');
chai.use(chaiHttp);
var Mongoose = require('mongoose').Mongoose,
mongoose = new Mongoose,
Mockgoose = require('mockgoose').Mockgoose,
mockgoose = new Mockgoose(mongoose);
var server = require('../../../app');
var productFamily = require('../../../api/models/referenceData/productFamilyModel');
var productType = require('../../../api/models/referenceData/productTypeModel');
var product = require('../../../api/models/product/productModel');
var delivery = require('../../../api/models/delivery/deliveryModel');
var deliveryId;
var prod_common_cases = require("../common/product-common-cases");
var country_state_district_cases = require("../common/country-state-district-common-cases");
var delivery_common_cases=require("../common/delivery-common-cases");
describe('Delivery API', function() {
before(function (done) {
mockgoose.helper.reset().then(function() {
done();
});
});
//Test1
it("isMocked", function (done) {
expect(mockgoose.helper.isMocked()).to.be.true;
done();
});
it("should create productFamily", function (done) {
prod_common_cases.create_prod_family(done);
});