Skip to content
This repository has been archived by the owner on May 10, 2021. It is now read-only.

Replace karma with jest #182

Merged
merged 7 commits into from
Aug 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .circleci/config.yml
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
25 changes: 25 additions & 0 deletions __tests__/Connect.js
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();
});
});
});
Loading