I use the following code as mocha test and I got error ""before all" hook failed"
I use the before event but not sure what I'm doing wrong here,any idea? while debug when I put BP on the JSON.parse it doesn't stops line after...
describe("Validations", function () {
before(function (done) {
var valid = require('../utils/valid');
_provideConfig()
.then(function (config) {
isValidURL = valid.url(config, "test2")
done();
}).done();
});
it("Validate URL ", function () {
expect(isValidURL).to.be.true;
});
});
_provideConfig = function () {
return new Promise(function (resolve, reject) {
var configJSON = {
"providers": [
{
"replace": {
"path": "cmd1",
"inc": "upd"
},
"save": {
"path": "test2",
"inc": "upd2"
}
}
]
};
var config = JSON.parse(configJSON);
console.log(config);
resolve(config);
});