I'm trying to write tests for an angular 5 application which uses a js import, I've been doing research but i cant seen to figure out how to mock the js import. In the test, I just want to check that the bar() method has been called using a spyOn but can't figure out how to do this.
import {foo} from 'fooProject';
export class Component {
constructor(){}
trigger() {
foo.bar();
}
}
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)