From 1439ba95048277ee37d2c004aefc4939d76683c6 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 18 Jun 2018 19:05:29 +0300 Subject: [PATCH] Test scripting updates --- package.json | 4 ++-- scripts/tdd.js | 12 +++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 60601fc5f..9694e7ef6 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/scripts/tdd.js b/scripts/tdd.js index 0ade624d5..6c60aced8 100644 --- a/scripts/tdd.js +++ b/scripts/tdd.js @@ -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');