From 7de0984d6d31f0b12a733c6da029ded96902808e Mon Sep 17 00:00:00 2001 From: Kazuhito Yokoi Date: Sun, 25 Feb 2024 17:38:46 +0900 Subject: [PATCH] Update test case for example flow name --- test/unit/@node-red/registry/lib/library_spec.js | 10 ++++------ .../registry/lib/resources/examples/1.2.3.json | 0 2 files changed, 4 insertions(+), 6 deletions(-) create mode 100644 test/unit/@node-red/registry/lib/resources/examples/1.2.3.json diff --git a/test/unit/@node-red/registry/lib/library_spec.js b/test/unit/@node-red/registry/lib/library_spec.js index 2e0e7e99a..75c444f67 100644 --- a/test/unit/@node-red/registry/lib/library_spec.js +++ b/test/unit/@node-red/registry/lib/library_spec.js @@ -33,16 +33,15 @@ describe("library api", function() { 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.addExamplesDir("test-module",path.resolve(__dirname+'/resources/examples')).then(function() { try { 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'); - examplePath.should.eql(path.resolve(__dirname+'/resources/examples/one.json')) - + examplePath.should.eql(path.resolve(__dirname+'/resources/examples/one.json')); library.removeExamplesDir('test-module'); @@ -57,6 +56,5 @@ describe("library api", function() { done(err); } }); - - }) + }); }); diff --git a/test/unit/@node-red/registry/lib/resources/examples/1.2.3.json b/test/unit/@node-red/registry/lib/resources/examples/1.2.3.json new file mode 100644 index 000000000..e69de29bb