From 45036be81673c7d406545b335f16b0e6173b924a Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Tue, 18 Aug 2020 16:08:29 +0530 Subject: [PATCH] reduced number of tests --- libs/remix-tests/tests/testRunner.spec.ts | 118 +++++++++++----------- workspace.json | 3 +- 2 files changed, 60 insertions(+), 61 deletions(-) diff --git a/libs/remix-tests/tests/testRunner.spec.ts b/libs/remix-tests/tests/testRunner.spec.ts index 74aaa3bc6c..975405298f 100644 --- a/libs/remix-tests/tests/testRunner.spec.ts +++ b/libs/remix-tests/tests/testRunner.spec.ts @@ -101,66 +101,66 @@ describe('testRunner', () => { describe('#runTest', () => { - describe('assert library OK method tests', () => { - const filename: string = __dirname + '/examples_0/assert_ok_test.sol' - - beforeAll((done) => { - compileAndDeploy(filename, (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) => { - runTest('AssertOkTest', contracts.AssertOkTest, compilationData[filename]['AssertOkTest'], asts[filename], { accounts }, testCallback, resultsCallback(done)) - }) - }) - - afterAll(() => { tests = [] }) - - it('should have 1 passing test', () => { - assert.equal(results.passingNum, 1) - }) - - it('should have 1 failing test', () => { - assert.equal(results.failureNum, 1) - }) - - it('should return', () => { - deepEqualExcluding(tests, [ - { type: 'accountList', value: accounts }, - { type: 'contract', value: 'AssertOkTest', filename: __dirname + '/examples_0/assert_ok_test.sol' }, - { type: 'testPass', value: 'Ok pass test', context: 'AssertOkTest' }, - { type: 'testFailure', value: 'Ok fail test', errMsg: 'okFailTest fails', context: 'AssertOkTest', expected: 'true', returned: 'false'}, + // describe('assert library OK method tests', () => { + // const filename: string = __dirname + '/examples_0/assert_ok_test.sol' + + // beforeAll((done) => { + // compileAndDeploy(filename, (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) => { + // runTest('AssertOkTest', contracts.AssertOkTest, compilationData[filename]['AssertOkTest'], asts[filename], { accounts }, testCallback, resultsCallback(done)) + // }) + // }) + + // afterAll(() => { tests = [] }) + + // it('should have 1 passing test', () => { + // assert.equal(results.passingNum, 1) + // }) + + // it('should have 1 failing test', () => { + // assert.equal(results.failureNum, 1) + // }) + + // it('should return', () => { + // deepEqualExcluding(tests, [ + // { type: 'accountList', value: accounts }, + // { type: 'contract', value: 'AssertOkTest', filename: __dirname + '/examples_0/assert_ok_test.sol' }, + // { type: 'testPass', value: 'Ok pass test', context: 'AssertOkTest' }, + // { type: 'testFailure', value: 'Ok fail test', errMsg: 'okFailTest fails', context: 'AssertOkTest', expected: 'true', returned: 'false'}, - ], ['time']) - }) - }) - - describe('assert library EQUAL method tests', () => { - const filename: string = __dirname + '/examples_0/assert_equal_test.sol' - - beforeAll((done) => { - compileAndDeploy(filename, (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) => { - runTest('AssertEqualTest', contracts.AssertEqualTest, compilationData[filename]['AssertEqualTest'], asts[filename], { accounts }, testCallback, resultsCallback(done)) - }) - }) - - afterAll(() => { tests = [] }) - - it('should have 2 passing test', () => { - assert.equal(results.passingNum, 2) - }) - - it('should have 2 failing test', () => { - assert.equal(results.failureNum, 2) - }) - - it('should return', () => { - deepEqualExcluding(tests, [ - { type: 'accountList', value: accounts }, - { type: 'contract', value: 'AssertEqualTest', filename: __dirname + '/examples_0/assert_equal_test.sol' }, - { type: 'testPass', value: 'Equal uint pass test', context: 'AssertEqualTest' }, - { type: 'testFailure', value: 'Equal uint fail test', errMsg: 'equalUintFailTest fails', context: 'AssertEqualTest', expected: '2', returned: '1'}, - { type: 'testPass', value: 'Equal int pass test', context: 'AssertEqualTest' }, - { type: 'testFailure', value: 'Equal int fail test', errMsg: 'equalIntFailTest fails', context: 'AssertEqualTest', expected: '2', returned: '-1'} - ], ['time']) - }) - }) + // ], ['time']) + // }) + // }) + + // describe('assert library EQUAL method tests', () => { + // const filename: string = __dirname + '/examples_0/assert_equal_test.sol' + + // beforeAll((done) => { + // compileAndDeploy(filename, (_err: Error | null | undefined, compilationData: object, contracts: any, asts: any, accounts: string[]) => { + // runTest('AssertEqualTest', contracts.AssertEqualTest, compilationData[filename]['AssertEqualTest'], asts[filename], { accounts }, testCallback, resultsCallback(done)) + // }) + // }) + + // afterAll(() => { tests = [] }) + + // it('should have 2 passing test', () => { + // assert.equal(results.passingNum, 2) + // }) + + // it('should have 2 failing test', () => { + // assert.equal(results.failureNum, 2) + // }) + + // it('should return', () => { + // deepEqualExcluding(tests, [ + // { type: 'accountList', value: accounts }, + // { type: 'contract', value: 'AssertEqualTest', filename: __dirname + '/examples_0/assert_equal_test.sol' }, + // { type: 'testPass', value: 'Equal uint pass test', context: 'AssertEqualTest' }, + // { type: 'testFailure', value: 'Equal uint fail test', errMsg: 'equalUintFailTest fails', context: 'AssertEqualTest', expected: '2', returned: '1'}, + // { type: 'testPass', value: 'Equal int pass test', context: 'AssertEqualTest' }, + // { type: 'testFailure', value: 'Equal int fail test', errMsg: 'equalIntFailTest fails', context: 'AssertEqualTest', expected: '2', returned: '-1'} + // ], ['time']) + // }) + // }) describe('assert library NOTEQUAL method tests', () => { const filename: string = __dirname + '/examples_0/assert_notEqual_test.sol' diff --git a/workspace.json b/workspace.json index c6586e0edd..d81084a528 100644 --- a/workspace.json +++ b/workspace.json @@ -384,8 +384,7 @@ "builder": "@nrwl/jest:jest", "options": { "jestConfig": "libs/remix-tests/jest.config.js", - "tsConfig": "libs/remix-tests/tsconfig.spec.json", - "runInBand": true + "tsConfig": "libs/remix-tests/tsconfig.spec.json" } }, "build": {