This repository has been archived by the owner on May 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add jest for web3 tests * ethereum tests working * Connect tests working * subprovider tests working * all tests passing with jest * tests on the CI working * delete old, karma-related files
- Loading branch information
1 parent
87af8dd
commit 748d0ff
Showing
26 changed files
with
7,242 additions
and
6,815 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
version: 2 | ||
jobs: | ||
build: | ||
working_directory: ~/uport-connect | ||
docker: | ||
- image: circleci/node:8-browsers | ||
steps: | ||
- checkout | ||
|
||
# Download and cache dependencies | ||
- restore_cache: | ||
keys: | ||
- dependencies-cache-{{ checksum "package.json" }} | ||
|
||
- run: | ||
name: install-dependencies | ||
command: yarn | ||
|
||
- run: | ||
name: test | ||
command: npm run test:jest | ||
|
||
- run: | ||
name: code-coverage | ||
command: bash <(curl -s https://codecov.io/bash) | ||
|
||
- run: | ||
name: dist | ||
command: npm run build-dist && npm run build-dist-prod | ||
|
||
- save_cache: | ||
key: dependency-cache-{{ checksum "package.json" }} | ||
paths: | ||
- ./node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Connect } from "../src/index"; | ||
import { Credentials } from "uport"; | ||
|
||
describe("Connect", () => { | ||
describe("config", () => { | ||
it("defaults", () => { | ||
const uport = new Connect("test app"); | ||
expect(uport.appName).toEqual("test app"); | ||
expect(uport.infuraApiKey).toEqual("test-app"); | ||
expect(uport.uriHandler.name).toEqual("openQr"); | ||
expect(uport.network.id).toEqual("0x4"); | ||
expect(uport.closeUriHandler.name).toEqual("closeQr"); | ||
expect(uport.credentials).toBeInstanceOf(Credentials); | ||
expect(uport.canSign).toBeFalsy(); | ||
expect(uport.getWeb3).toBeDefined(); | ||
}); | ||
|
||
it("does not have a closeUriHandler if not using built in openQr", () => { | ||
const noop = uri => null; | ||
const uport = new Connect("test", { uriHandler: noop }); | ||
expect(uport.uriHandler).toEqual(noop); | ||
expect(uport.closeUriHandler).toBeUndefined(); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.