Test scripting updates

This commit is contained in:
Angelos Chalaris
2018-06-18 19:05:29 +03:00
parent 584ed191d4
commit ed3b40c4f2
2 changed files with 5 additions and 11 deletions

View File

@ -33,8 +33,8 @@
"extractor": "node ./scripts/extract.js",
"packager": "node ./scripts/module.js",
"localizer": "node ./scripts/localize.js",
"test": "tape test/**/*.test.js | tap-spec",
"test2": "jest test/**/*.test.js"
"testold": "tape test/**/*.test.js | tap-spec",
"test": "jest test/**/*.test.js"
},
"repository": {
"type": "git",

View File

@ -64,16 +64,10 @@ snippetFiles
// Export template for snippetName.test.js which generates a example test & other information
const exportTest = [
`const test = require('tape');`,
`const expect = require('expect');`,
`const ${fileName} = require('./${fileName}.js');`,
`\ntest('Testing ${fileName}', (t) => {`,
` //For more information on all the methods supported by tape\n //Please go to https://github.com/substack/tape`,
` t.true(typeof ${fileName} === 'function', '${fileName} is a Function');`,
` //t.deepEqual(${fileName}(args..), 'Expected');`,
` //t.equal(${fileName}(args..), 'Expected');`,
` //t.false(${fileName}(args..), 'Expected');`,
` //t.throws(${fileName}(args..), 'Expected');`,
` t.end();`,
`\ntest('${fileName} is a Function', () => {`,
` expect(${fileName}).toBeInstanceOf(Function);`,
`});`
].join('\n');