Skip to content
This repository
Browse code

Added check to ensure package.json name is correctly set to parent fo…

…lder name
  • Loading branch information...
commit b47457181717125ec69ad8d8105697e04159c9e3 1 parent 1be7efe
Ryan Kirkman ryankirkman authored

Showing 1 changed file with 7 additions and 0 deletions. Show diff stats Hide diff stats

  1. +7 0 test/valid-packages-test.js
7 test/valid-packages-test.js
@@ -100,6 +100,13 @@ packages.map(function (pkg) {
100 100 assert.ok(fs.existsSync(filePath),
101 101 filePath +" does not exist but is referenced in package.json!");
102 102 };
  103 + package_vows[pname + ": name in package.json should be parent folder name"] = function (pkg) {
  104 + var json = parse(pkg, true, true);
  105 + var dirs = pkg.split("/");
  106 + var trueName = dirs[dirs.length - 2];
  107 + assert.ok(trueName == json.name,
  108 + pkg_name(pkg) + ": Name property should be '" + trueName + "', not '" + json.name +"'");
  109 + };
103 110
104 111 context[pname] = package_vows;
105 112 suite.addBatch(context);

0 comments on commit b474571

Please sign in to comment.
Something went wrong with that request. Please try again.