1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

update defaultFileSet test for i18n support

This commit is contained in:
Hiroyasu Nishiyama 2018-05-27 22:30:05 +09:00
parent 4565342b05
commit a84b2ab5bb

View File

@ -19,6 +19,13 @@ var should = require("should");
var defaultFileSet = require("../../../../../../red/runtime/storage/localfilesystem/projects/defaultFileSet"); var defaultFileSet = require("../../../../../../red/runtime/storage/localfilesystem/projects/defaultFileSet");
describe('storage/localfilesystem/projects/defaultFileSet', function() { describe('storage/localfilesystem/projects/defaultFileSet', function() {
var runtime = {
i18n: {
"_": function(name) {
return name;
}
}
};
it('generates package.json for a project', function() { it('generates package.json for a project', function() {
var generated = defaultFileSet["package.json"]({ var generated = defaultFileSet["package.json"]({
name: "A TEST NAME", name: "A TEST NAME",
@ -27,7 +34,7 @@ describe('storage/localfilesystem/projects/defaultFileSet', function() {
flow: "MY FLOW FILE", flow: "MY FLOW FILE",
credentials: "MY CREDENTIALS FILE" credentials: "MY CREDENTIALS FILE"
} }
}); }, runtime);
var parsed = JSON.parse(generated); var parsed = JSON.parse(generated);
parsed.should.have.property('name',"A TEST NAME"); parsed.should.have.property('name',"A TEST NAME");
@ -42,7 +49,7 @@ describe('storage/localfilesystem/projects/defaultFileSet', function() {
var generated = defaultFileSet["README.md"]({ var generated = defaultFileSet["README.md"]({
name: "A TEST NAME", name: "A TEST NAME",
summary: "A TEST SUMMARY" summary: "A TEST SUMMARY"
}); }, runtime);
generated.should.match(/A TEST NAME/); generated.should.match(/A TEST NAME/);
generated.should.match(/A TEST SUMMARY/); generated.should.match(/A TEST SUMMARY/);
}); });
@ -50,7 +57,7 @@ describe('storage/localfilesystem/projects/defaultFileSet', function() {
var generated = defaultFileSet[".gitignore"]({ var generated = defaultFileSet[".gitignore"]({
name: "A TEST NAME", name: "A TEST NAME",
summary: "A TEST SUMMARY" summary: "A TEST SUMMARY"
}); }, runtime);
generated.length.should.be.greaterThan(0); generated.length.should.be.greaterThan(0);
}); });
}); });