[Unit test] jasmine createSpyObj
beforeEach(() => {
contextStub = {
debug: false,
engine: jasmine.createSpyObj(‘engine‘, [
‘createCollection‘, ‘createContext‘, ‘createSchematic‘,
‘createSourceFromUrl‘, ‘transformOptions‘, ‘executePostTasks‘
]),
logger: jasmine.createSpyObj(‘logger‘, [‘info‘]),
schematic: jasmine.createSpyObj(‘schematic‘, [‘call‘]),
strategy: 0,
interactive: false,
addTask: jasmine.createSpy()
};
});
it(‘schedules an npm install task if Material is not installed‘, () => {
const rule = installMaterial();
rule(testTree, contextStub);
expect(contextStub.addTask).toHaveBeenCalled();
expect(contextStub.logger.info).toHaveBeenCalledWith(‘Installing Angular Material...‘);
}); 相关推荐
runner 2020-09-01
JASMINE花酱 2020-04-16
酒囊饭袋 2020-03-11
灰帽jasmine 2016-11-15
Blovesea 2016-07-06
JASMINE花酱 2019-06-27
jinhailion 2014-11-16
wangmiaoyan 2014-09-04
thug 2019-06-26
83437713 2014-05-20
itclkang 2014-05-15
runner 2014-01-17
jinhailion 2019-06-25
dllyj 2019-06-21
灰帽jasmine 2019-06-21
luochaotj 2013-03-28
dllyj 2012-05-11
JASMINE花酱 2018-12-26
swywkci 2019-05-08