Update test case for example flow name

This commit is contained in:
Kazuhito Yokoi 2024-02-25 17:38:46 +09:00
parent 635334f096
commit 7de0984d6d
2 changed files with 4 additions and 6 deletions

View File

@ -33,16 +33,15 @@ describe("library api", function() {
should.not.exist(library.getExampleFlowPath('foo','bar')); should.not.exist(library.getExampleFlowPath('foo','bar'));
}); });
it('returns a valid example path', function(done) { it('returns valid example paths', function(done) {
library.init(); library.init();
library.addExamplesDir("test-module",path.resolve(__dirname+'/resources/examples')).then(function() { library.addExamplesDir("test-module",path.resolve(__dirname+'/resources/examples')).then(function() {
try { try {
var flows = library.getExampleFlows(); var flows = library.getExampleFlows();
flows.should.deepEqual({"test-module":{"f":["one"]}}); flows.should.deepEqual({"test-module":{"f":["1.2.3","one"]}});
var examplePath = library.getExampleFlowPath('test-module','one'); var examplePath = library.getExampleFlowPath('test-module','one');
examplePath.should.eql(path.resolve(__dirname+'/resources/examples/one.json')) examplePath.should.eql(path.resolve(__dirname+'/resources/examples/one.json'));
library.removeExamplesDir('test-module'); library.removeExamplesDir('test-module');
@ -57,6 +56,5 @@ describe("library api", function() {
done(err); done(err);
} }
}); });
});
})
}); });