Skip to content

Commit

Permalink
test cases done
Browse files Browse the repository at this point in the history
  • Loading branch information
Snafkin547 committed Mar 21, 2024
1 parent c5f3a12 commit bf78eb8
Show file tree
Hide file tree
Showing 7 changed files with 276 additions and 20 deletions.
9 changes: 9 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
transform: {
'^.+\\.ts$': 'ts-jest',
},
moduleFileExtensions: ['ts', 'js', 'json', 'node'],
};
208 changes: 207 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
"ws": "^7.3.1"
},
"devDependencies": {
"@types/jest": "^29.5.12",
"@types/node": "^20.11.30",
"browserify": "^16.5.2",
"chai": "^4.1.2",
"clean-jsdoc-theme": "^4.2.17",
Expand All @@ -77,6 +79,8 @@
"marked": "^4.0.10",
"minimist": "^1.2.0",
"mocha": "^4.1.0",
"neptune-notebook": "^1.3.1"
"neptune-notebook": "^1.3.1",
"ts-jest": "^29.1.2",
"typescript": "^5.4.3"
}
}
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
interface Entries {
[key:number]:number
}


describe('JIFF Operations', () => {

// Setup JIFF Client
const JIFFClient = require("../../lib/jiff-client.js");

const options = {
party_count: 2,
crypto_provider: true,
Zp: 562949948117,
};

var jiffClient = new JIFFClient(
"http://localhost:8112",
"our-setup-application",
options,
);

var entries: Entries;

beforeAll(async () => {

// Setup JIFF Client
const options = {
party_count: 2,
crypto_provider: true,
Zp: 562949948117,
};
const JIFFClient = require("../../lib/jiff-client.js");
jiffClient = new JIFFClient(
"http://localhost:8112",
"our-setup-application",
options,
);

// Add JIFF Extensions
const jiff_bignumber = require("../../lib/ext/jiff-client-bignumber.js");
const jiff_fixedpoint = require("../../lib/ext/jiff-client-fixedpoint.js");
const jiff_negativenumber = require("../../lib/ext/jiff-client-negativenumber.js");
jiffClient.apply_extension(jiff_bignumber, options);
jiffClient.apply_extension(jiff_fixedpoint, options);
jiffClient.apply_extension(jiff_negativenumber, options);
await jiffClient.apply_extension(jiff_bignumber, options);
await jiffClient.apply_extension(jiff_fixedpoint, options);
await jiffClient.apply_extension(jiff_negativenumber, options);

entries = { 1: 60, 2: 60 };
});

Expand Down
4 changes: 2 additions & 2 deletions tests/arithmetics/execute.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
target='arithmetics.test.js'
target='arithmetics.test.ts'

node ./tests/arithmetics/server.js &
node ./tests/arithmetics/server.ts &
npx jest ./tests/arithmetics/$target&
wait
File renamed without changes.
Loading

0 comments on commit bf78eb8

Please sign in to comment.