Skip to content

Commit e3216b4

Browse files
committed
Merge pull request #315 from xinUmbralis/fix-313-generate-scripts
Fix 313 generate scripts
2 parents 829d0b9 + 3006ad2 commit e3216b4

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ This is a guide on how to contribute test cases to help with coverage testing fo
88
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
99

1010
``` bash
11-
npm run missing-tests
11+
npm run generateMissingTests
1212
```
1313

14-
This will make the file `generate/missing-tests.json` which will contain info for tests or files that are currently missing.
14+
This will make the file `generate/output/missing-tests.json` which will contain info for tests or files that are currently missing.
1515

1616
From this file you can find fields and functions that don't have any tests yet and pick one to work on.
1717

@@ -42,7 +42,7 @@ If a specific field or function is further wrapped via a file inside of `/lib` t
4242

4343
You can mark something to be ignored inside of the `/generate/missing-tests-ignore.json` file.
4444

45-
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.
45+
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.
4646

4747
## Test results ##
4848

generate/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
require("./scripts/generateJson")();
2-
require("./scripts/generateNativeCode")();
3-
require("./scripts/generateMissingTests")();
1+
require("./scripts/generateJson");
2+
require("./scripts/generateNativeCode");
3+
require("./scripts/generateMissingTests");

generate/scripts/generateJson.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var libgit2 = require("../input/v" + version + ".json");
99
var descriptor = require("../input/descriptor.json");
1010
var supplement = require("../input/libgit2-supplement.json");
1111

12-
module.exports = function() {
12+
module.exports = (function generateJson() {
1313
libgit2.types.forEach(function(type) {
1414
if (supplement.types[type[0]]){
1515
_.merge(type[1], supplement.types[type[0]]);
@@ -219,4 +219,4 @@ module.exports = function() {
219219

220220
utils.writeFile("output/idefs.json", output);
221221

222-
}
222+
}());

generate/scripts/generateMissingTests.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const testFilesPath = "../test/tests";
88
const idefs = require("../output/idefs");
99
const missingFileIgnores = require("../input/ignored-missing-tests");
1010

11-
module.exports = function() {
11+
module.exports = (function generateMissingTests() {
1212
var output = {};
1313

1414
function findMissingTest(idef) {
@@ -70,4 +70,5 @@ module.exports = function() {
7070
}
7171
);
7272

73-
}
73+
}());
74+

generate/scripts/generateNativeCode.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const exec = promisify(function(command, opts, callback) {
2020
const utils = require("./utils");
2121
const idefs = require("../output/idefs");
2222

23-
module.exports = function() {
23+
module.exports = (function generateNativeCode() {
2424
// Customize the delimiters so as to not process `{{{` or `}}}`.
2525
combyne.settings.delimiters = {
2626
START_RAW: "{{=",
@@ -143,4 +143,4 @@ module.exports = function() {
143143
})
144144
});
145145

146-
}
146+
}());

0 commit comments

Comments
 (0)