From 53e0f0569f0138bd8bf38472ac9d42e4130cbe4c Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Thu, 13 Feb 2020 08:33:42 +0100 Subject: [PATCH] add test script to node --- jenkins.js | 2 +- snippets/node/index.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jenkins.js b/jenkins.js index 099b983..7080af9 100644 --- a/jenkins.js +++ b/jenkins.js @@ -13,7 +13,7 @@ const pkg = JSON.parse (fs.readFileSync ('package.json', 'utf-8')); fs.writeFileSync ('package.json', JSON.stringify (pkg, null, 2)); child_process.execSync ('yarn lint', { stdio: 'inherit' }); -if (typeof pkg.scripts !=='undefined' && typeof pkg.scripts.test === 'string') +if (typeof pkg.scripts !== 'undefined' && typeof pkg.scripts.test === 'string') child_process.execSync ('yarn test', { stdio: 'inherit' }); child_process.exec ('git log -1 | grep \'\\[no publish\\]\'') diff --git a/snippets/node/index.js b/snippets/node/index.js index 53c89ea..64a793a 100644 --- a/snippets/node/index.js +++ b/snippets/node/index.js @@ -45,7 +45,7 @@ async function run (folder, args) { { cwd: snip_folder, stdio: 'inherit' } ); child_process.execSync ( - 'yarn add --dev @scode/eslint-config eslint', + 'yarn add --dev @scode/eslint-config eslint nyc ava', { cwd: snip_folder, stdio: 'inherit' } ); @@ -53,7 +53,7 @@ async function run (folder, args) { await fs.readFile (path.join (snip_folder, 'package.json'), 'utf-8') ); - package_json.scripts = { lint: 'eslint .' }; + package_json.scripts = { lint: 'eslint .', test: 'nyc ava' }; await fs.writeFile ( path.join (snip_folder, 'package.json'),