unit.test.js
describe('mock-testing', () => {
it('should use mock1', () => {
//arrange
systemUnderTest.test(mock);
//act
const result = systemUnderTest.get();
//assert
}
}
mock.js
exports.get = () => {
return [{obj1},{obj2}];
}
我可以在不同情况下将多个.get
放在mock.js
中吗?