test for custom runs

pull/741/head
aniket-engg 4 years ago
parent f0721bd5c1
commit 9c0bb0fb1b
  1. 14
      libs/remix-tests/tests/testRunner.cli.spec.ts

@ -90,5 +90,19 @@ Commands:
// macth fail test details
expect(res.stdout.toString().trim()).toMatch(/error: okFailTest fails/)
})
test('remix-tests running a test file by enabling optimization and setting runs', () => {
const res = spawnSync(executablePath, ['--optimize', 'true', '--runs', '300', resolve(__dirname + '/examples_0/assert_ok_test.sol')])
// match initial lines
expect(res.stdout.toString().trim().includes('Optimization is enabled')).toBeTruthy()
expect(res.stdout.toString().trim().includes('Runs set to 300')).toBeTruthy()
expect(res.stdout.toString().trim()).toMatch(/:: Running remix-tests - Unit testing for solidity ::/)
expect(res.stdout.toString().trim()).toMatch(/creation of library remix_tests.sol:Assert pending.../)
// match test result
expect(res.stdout.toString().trim()).toMatch(/Ok pass test/)
expect(res.stdout.toString().trim()).toMatch(/Ok fail test/)
// macth fail test details
expect(res.stdout.toString().trim()).toMatch(/error: okFailTest fails/)
})
})
})
Loading…
Cancel
Save