diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b8f6b7ce1..d7a981aad 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,10 +8,10 @@ This is a guide on how to contribute test cases to help with coverage testing fo Currently there are a number of fields and functions in NodeGit that have no tests at all. A list of which files are missing and what fields and functions need tests can be generated by running ``` bash -npm run missing-tests +npm run generateMissingTests ``` -This will make the file `generate/missing-tests.json` which will contain info for tests or files that are currently missing. +This will make the file `generate/output/missing-tests.json` which will contain info for tests or files that are currently missing. From this file you can find fields and functions that don't have any tests yet and pick one to work on. @@ -42,7 +42,7 @@ If a specific field or function is further wrapped via a file inside of `/lib` t You can mark something to be ignored inside of the `/generate/missing-tests-ignore.json` file. -After you write your test make sure to run `npm run missing-tests` again to confirm that the field/function that a test was written for no longer shows up. +After you write your test make sure to run `npm run generateMissingTests` again to confirm that the field/function that a test was written for no longer shows up. ## Test results ## diff --git a/generate/index.js b/generate/index.js index 536dce70a..9eea74ecf 100644 --- a/generate/index.js +++ b/generate/index.js @@ -1,3 +1,3 @@ -require("./scripts/generateJson")(); -require("./scripts/generateNativeCode")(); -require("./scripts/generateMissingTests")(); +require("./scripts/generateJson"); +require("./scripts/generateNativeCode"); +require("./scripts/generateMissingTests"); diff --git a/generate/scripts/generateJson.js b/generate/scripts/generateJson.js index 4bf029587..35430bff4 100644 --- a/generate/scripts/generateJson.js +++ b/generate/scripts/generateJson.js @@ -9,7 +9,7 @@ var libgit2 = require("../input/v" + version + ".json"); var descriptor = require("../input/descriptor.json"); var supplement = require("../input/libgit2-supplement.json"); -module.exports = function() { +module.exports = (function generateJson() { libgit2.types.forEach(function(type) { if (supplement.types[type[0]]){ _.merge(type[1], supplement.types[type[0]]); @@ -219,4 +219,4 @@ module.exports = function() { utils.writeFile("output/idefs.json", output); -} +}()); diff --git a/generate/scripts/generateMissingTests.js b/generate/scripts/generateMissingTests.js index 6dfc06539..1b6c7aae2 100644 --- a/generate/scripts/generateMissingTests.js +++ b/generate/scripts/generateMissingTests.js @@ -8,7 +8,7 @@ const testFilesPath = "../test/tests"; const idefs = require("../output/idefs"); const missingFileIgnores = require("../input/ignored-missing-tests"); -module.exports = function() { +module.exports = (function generateMissingTests() { var output = {}; function findMissingTest(idef) { @@ -70,4 +70,5 @@ module.exports = function() { } ); -} +}()); + diff --git a/generate/scripts/generateNativeCode.js b/generate/scripts/generateNativeCode.js index 0960ec357..c277e0e9f 100644 --- a/generate/scripts/generateNativeCode.js +++ b/generate/scripts/generateNativeCode.js @@ -20,7 +20,7 @@ const exec = promisify(function(command, opts, callback) { const utils = require("./utils"); const idefs = require("../output/idefs"); -module.exports = function() { +module.exports = (function generateNativeCode() { // Customize the delimiters so as to not process `{{{` or `}}}`. combyne.settings.delimiters = { START_RAW: "{{=", @@ -143,4 +143,4 @@ module.exports = function() { }) }); -} +}());