Skip to content

Commit 0fa4aa8

Browse files
committed
test for custom runs
1 parent 6f7a5c0 commit 0fa4aa8

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

libs/remix-tests/tests/testRunner.cli.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,19 @@ Commands:
9090
// macth fail test details
9191
expect(res.stdout.toString().trim()).toMatch(/error: okFailTest fails/)
9292
})
93+
94+
test('remix-tests running a test file by enabling optimization and setting runs', () => {
95+
const res = spawnSync(executablePath, ['--optimize', 'true', '--runs', '300', resolve(__dirname + '/examples_0/assert_ok_test.sol')])
96+
// match initial lines
97+
expect(res.stdout.toString().trim().includes('Optimization is enabled')).toBeTruthy()
98+
expect(res.stdout.toString().trim().includes('Runs set to 300')).toBeTruthy()
99+
expect(res.stdout.toString().trim()).toMatch(/:: Running remix-tests - Unit testing for solidity ::/)
100+
expect(res.stdout.toString().trim()).toMatch(/creation of library remix_tests.sol:Assert pending.../)
101+
// match test result
102+
expect(res.stdout.toString().trim()).toMatch(/Ok pass test/)
103+
expect(res.stdout.toString().trim()).toMatch(/Ok fail test/)
104+
// macth fail test details
105+
expect(res.stdout.toString().trim()).toMatch(/error: okFailTest fails/)
106+
})
93107
})
94108
})

0 commit comments

Comments
 (0)