Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #380 from blockchain/deps
Browse files Browse the repository at this point in the history
Re-enable test, update test related deps
  • Loading branch information
Sjors authored May 10, 2017
2 parents 5b8ef28 + 74f720c commit 225ac61
Show file tree
Hide file tree
Showing 6 changed files with 855 additions and 703 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cache:
before_install:
- npm install -g snazzy
before_script:
- node_modules/.bin/semistandard --verbose | snazzy
- make semistandard
script:
- node_modules/karma/bin/karma start karma.conf.js --single-run
- make test
- cat ./coverage-lcov/lcov.info | node_modules/coveralls/bin/coveralls.js
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@ all: clean node_modules semistandard test dist/my-wallet.js dist/my-wallet.min.j
node_modules:
yarn

build: node_modules
node_modules/sjcl/sjcl.js: node_modules
cd node_modules/sjcl && ./configure --with-sha1 && make

build: node_modules node_modules/sjcl/sjcl.js
npm run build

test: build
# ./node_modules/karma/bin/karma start karma.conf.js --single-run
./node_modules/karma/bin/karma start karma.conf.js --single-run

dist/my-wallet.js: build

dist/my-wallet.min.js: node_modules
npm run dist

semistandard:
node_modules/.bin/semistandard
semistandard: node_modules
node_modules/.bin/semistandard --verbose | snazzy

# git-changelog uses the most recent tag, which is not what we want after we
# just tagged a release. Use the previous tag instead.
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"url": "https://github.com/blockchain/my-wallet-v3.git"
},
"scripts": {
"postinstall": "cd node_modules/sjcl || cd ../sjcl && ./configure --with-sha1 && make",
"dist": "NODE_ENV=\"prod\" ./node_modules/.bin/webpack",
"build": "./node_modules/.bin/webpack --progress",
"build:watch": "./node_modules/.bin/webpack -w",
Expand Down Expand Up @@ -69,18 +68,18 @@
"istanbul": "~0.4.5",
"jasmine-core": "^2.2.0",
"jasmine-es6-promise-matchers": "^2.0.1",
"karma": "0.13.*",
"karma": "1.7.*",
"karma-browserify": "5.1.*",
"karma-coverage": "1.1.*",
"karma-jasmine": "1.0.*",
"karma-jasmine": "1.1.*",
"karma-osx-reporter": "0.2.*",
"karma-phantomjs-launcher": "1.0.*",
"phantomjs-prebuilt": "2.1.*",
"proxyquireify": "3.2.*",
"semistandard": "8.*",
"string-replace-webpack-plugin": "0.0.5",
"watchify": "~3.9.0",
"webpack": "2.2.1"
"webpack": "2.5.*"
},
"semistandard": {
"ignore": [],
Expand Down
15 changes: 8 additions & 7 deletions tests/blockchain_wallet_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ let BIP39;
let RNG;

// TODO: use more mocks, this takes 45 seconds
// TODO: repair skipped tests (they cause PhantomJS to timeout)
describe('Blockchain-Wallet', () => {
let wallet;
let object = {
Expand Down Expand Up @@ -435,7 +436,7 @@ describe('Blockchain-Wallet', () => {
it('spendableActiveAddresses', () => expect(wallet.spendableActiveAddresses.length).toEqual(1));
});

describe('loadMetadata', () => {
xdescribe('loadMetadata', () => {
it('should set labels', (done) => {
let checks = () => {
expect(wallet.labels).toEqual({mock: 'labels'});
Expand All @@ -451,7 +452,7 @@ describe('Blockchain-Wallet', () => {
});
});

describe('Method', () => {
xdescribe('Method', () => {
it('.containsLegacyAddress should find address', () => {
let adr = '1ASqDXsKYqcx7dkKZ74bKBBggpd5HDtjCv';
expect(wallet.containsLegacyAddress(adr)).toBeTruthy();
Expand Down Expand Up @@ -529,7 +530,7 @@ describe('Blockchain-Wallet', () => {
});
});

describe('with second password', () => {
xdescribe('with second password', () => {
beforeEach(() => {
wallet._double_encryption = true;
});
Expand Down Expand Up @@ -573,13 +574,13 @@ describe('Blockchain-Wallet', () => {
});
});

it('.validateSecondPassword', () => {
xit('.validateSecondPassword', () => {
wallet.encrypt('batteryhorsestaple');
expect(wallet.isDoubleEncrypted).toBeTruthy();
expect(wallet.validateSecondPassword('batteryhorsestaple')).toBeTruthy();
});

describe('.encrypt', () => {
xdescribe('.encrypt', () => {
let cb = {
success () {},
error () {},
Expand Down Expand Up @@ -614,7 +615,7 @@ describe('Blockchain-Wallet', () => {
});
});

it('.decrypt', () => {
xdescribe('.decrypt', () => {
let cb = {
success () {},
error () {},
Expand Down Expand Up @@ -877,7 +878,7 @@ describe('Blockchain-Wallet', () => {
})
);

describe('_getPrivateKey', () => {
xdescribe('_getPrivateKey', () => {
it('should not compute private keys for non existent accounts', () => expect(() => wallet._getPrivateKey(-1, 'm/0/1')).toThrow());

it('should not compute private keys for invalid paths accounts', () => expect(() => wallet._getPrivateKey(0, 10)).toThrow());
Expand Down
4 changes: 2 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

const path = require('path');
let webpack = require('webpack');
let StringReplacePlugin = require('string-replace-webpack-plugin');

let config = {
entry: './index.js',
output: {
path: 'dist',
path: path.resolve(__dirname, 'dist'),
filename: 'my-wallet.js',
library: 'Blockchain',
libraryTarget: 'var'
Expand Down
Loading

0 comments on commit 225ac61

Please sign in to comment.