From 875a50b23c514f6c8408b9492150816668c076b3 Mon Sep 17 00:00:00 2001 From: Dallas Johnson Date: Mon, 7 Oct 2019 22:46:32 +0100 Subject: [PATCH] In order to speed up development of writing and running tests adding the `skip-build` option to the lamington command to skip the unnecessary step of building the contracts and type definitions on each running of the tests. --- src/cli/index.ts | 2 +- src/cli/lamington-test.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cli/index.ts b/src/cli/index.ts index 4702bbe..8b7755b 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -11,7 +11,7 @@ program .command('build [contract_path]', 'build all smart contracts') .command('start', 'start the eos blockchain in docker') .command('stop', 'stop the eos blockchain in docker') - .command('test', 'run your unit / integration tests') + .command('test [skip-build]', 'run your unit / integration tests') .on('*', () => { console.log('Unknown Command: ' + program.args.join(' ')); program.help(); diff --git a/src/cli/lamington-test.ts b/src/cli/lamington-test.ts index 4d23749..2287854 100644 --- a/src/cli/lamington-test.ts +++ b/src/cli/lamington-test.ts @@ -11,6 +11,9 @@ import { ConfigManager } from '../configManager'; const run = async () => { // Initialize the configuration await ConfigManager.initWithDefaults(); + const args = process.argv; + + console.log('args: ' + args); // Stop running instances for fresh test environment if (await eosIsReady()) { @@ -22,7 +25,9 @@ const run = async () => { await startEos(); } // Start compiling smart contracts + if (!args.includes('skip-build')) { await buildAll(); + } // Begin running tests await runTests(); // Stop EOSIO instance if keepAlive is false