Skip to content

Commit

Permalink
Run tests with mocha instead of jest (#28)
Browse files Browse the repository at this point in the history
* Use mocha instead of jest

* Increase number of iterations

* coverage with nyc
  • Loading branch information
Kenadia authored Jan 15, 2021
1 parent 09aa70c commit a09cc38
Show file tree
Hide file tree
Showing 14 changed files with 775 additions and 16 deletions.
2 changes: 2 additions & 0 deletions __tests__/helpers/assets.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Unit tests for helpers/assets.
*/

import expect from 'expect';

import {
ASSET_ID_MAP,
COLLATERAL_ASSET_ID,
Expand Down
2 changes: 2 additions & 0 deletions __tests__/helpers/crypto.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Unit tests for helpers/crypto.
*/

import expect from 'expect';

import { KeyPair } from '../../src/types';

// Module under test.
Expand Down
2 changes: 2 additions & 0 deletions __tests__/helpers/misc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Unit tests for helpers/misc.
*/

import expect from 'expect';

// Module under test.
import {
nonceFromClientId,
Expand Down
2 changes: 2 additions & 0 deletions __tests__/keys.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Unit tests for keys.ts.
*/

import expect from 'expect';

import {
KeyPair,
} from '../src/types';
Expand Down
2 changes: 2 additions & 0 deletions __tests__/signable/api-request.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Unit tests for signable/api-request.ts.
*/

import expect from 'expect';

import {
ApiMethod,
ApiRequestParams,
Expand Down
2 changes: 2 additions & 0 deletions __tests__/signable/oracle-price.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Unit tests for signable/oracle-price.ts.
*/

import expect from 'expect';

import {
KeyPair,
OraclePriceWithAssetId,
Expand Down
3 changes: 2 additions & 1 deletion __tests__/signable/order.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/

import Big, { RoundingMode } from 'big.js';
import expect from 'expect';

import {
OrderWithClientId,
Expand Down Expand Up @@ -189,7 +190,7 @@ describe('SignableOrder', () => {

it('end-to-end', () => {
// Repeat some number of times.
for (let i = 0; i < 1; i++) {
for (let i = 0; i < 3; i++) {
const keyPair: KeyPair = generateKeyPairUnsafe();
const signableOrder = SignableOrder.fromOrder(mockOrder);
const signature = signableOrder.sign(keyPair.privateKey);
Expand Down
4 changes: 3 additions & 1 deletion __tests__/signable/withdrawal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Unit tests for signable/withdrawals.ts.
*/

import expect from 'expect';

import {
KeyPair,
StarkwareWithdrawal,
Expand Down Expand Up @@ -119,7 +121,7 @@ describe('SignableWithdrawal', () => {

it('end-to-end', () => {
// Repeat some number of times.
for (let i = 0; i < 1; i++) {
for (let i = 0; i < 3; i++) {
const keyPair: KeyPair = generateKeyPairUnsafe();
const signableWithdrawal = SignableWithdrawal.fromWithdrawal(mockWithdrawal);
const signature = signableWithdrawal.sign(keyPair.privateKey);
Expand Down
2 changes: 2 additions & 0 deletions __tests__/util.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Unit tests for util.ts.
*/

import expect from 'expect';

// Module under test.
import {
normalizeHex32,
Expand Down
5 changes: 0 additions & 5 deletions jest.config.js

This file was deleted.

5 changes: 0 additions & 5 deletions jest.globalSetup.js

This file was deleted.

1 change: 0 additions & 1 deletion jest.setup.js

This file was deleted.

Loading

0 comments on commit a09cc38

Please sign in to comment.