Je veux simuler un appel d'instanciation d'objet dans une autre fonction en Javascript en utilisant Jasmine JS avec Karma. L'extrait de code ressemble à ceci:Comment simuler un nouvel appel de création de fonction/objet en javascript en utilisant Jasmine?
ClassA = function(){
var objB = new ClassB(); // How to fake this call?
function method(){
// Want to test this method
}
}
ClassB = function(){
}