Sto provando a testare Intern per verificare se sarebbe adatto per un framework di test. Sto provando a testare il seguente codice in Intern.Impossibile accedere a Intern per eseguire il modulo Node.js
var HelloWorld;
HelloWorld = (function() {
function HelloWorld (name) {
this.name = name || "N/A";
}
HelloWorld.prototype.printHello = function() {
console.log('Hello, ' + this.name);
};
HelloWorld.prototype.changeName = function(name) {
if (name === null || name === undefined) {
throw new Error('Name is required');
}
this.name = name;
};
return HelloWorld;
})();
exports = module.exports = HelloWorld;
Il file si trova nella 'JS-test-progetti/node/lib/HelloWorld.js' e Intern si trova a 'js-test-progetti/stagista'. Sto usando il ramo 1.0 di Intern. Ogni volta che cerco di includere il file ed eseguire il test, non ottengo alcun output dopo "Defaulting to console reporter". Ecco il file di test.
define([
'intern!tdd',
'intern/chai!assert',
'dojo/node!../lib/HelloWorld'
], function (tdd, assert, HelloWorld) {
console.log(HelloWorld);
});
Per qualcuno non ha familiarità con il nodo. js, suonava come una pubblicazione di stage :) –
Odio quando non riesco a far fare al mio tirocinante ciò che voglio. – AaronLS