Skip to content
This repository has been archived by the owner on Oct 8, 2019. It is now read-only.

Commit

Permalink
Merge pull request #347 from blockchain/node5
Browse files Browse the repository at this point in the history
Use Node 5.10 and updated README
  • Loading branch information
Sjors committed Apr 8, 2016
2 parents 864298d + 484cb52 commit 63da637
Show file tree
Hide file tree
Showing 25 changed files with 77 additions and 73 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- '0.12'
- 5.10
before_install:
- npm install -g grunt-cli
- gem install sass
Expand Down
7 changes: 4 additions & 3 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ module.exports = (grunt) ->

concat:
options:
banner: "(function(){"
separator: ";"
banner: "(function () {\n"
separator: "})();\n(function () {\n"
footer: "})();"

application_dependencies:
Expand Down Expand Up @@ -173,7 +173,7 @@ module.exports = (grunt) ->

js:
files: [
{src: ["browser-polyfill.js"], dest: "build/js/", cwd: "node_modules/grunt-babel/node_modules/babel-core", expand: true}
{src: ["polyfill.js"], dest: "build/js/", cwd: "node_modules/babel-polyfill/dist", expand: true}
]


Expand Down Expand Up @@ -233,6 +233,7 @@ module.exports = (grunt) ->
babel:
options:
sourceMap: true
presets: ['es2015']
build:
files: [{
expand: true,
Expand Down
2 changes: 1 addition & 1 deletion app/index.jade
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ body(ng-controller="AppCtrl" ui-view="body" ng-mousemove="resetInactivityTime()"
script(src='build/js/core/walletNetwork.service.js')
script(src='build/js/core/helpers.service.js')

script(src='build/js/browser-polyfill.js')
script(src='build/js/polyfill.js')
script(src='build/js/app.js')
script(src='build/js/translations.js')

Expand Down
2 changes: 1 addition & 1 deletion assets/js/controllers/resetTwoFactor.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function ResetTwoFactorCtrl($scope, $rootScope, $http, $translate, WalletNetwork
$scope.fields.newEmail,
$scope.fields.secret,
$scope.fields.message,
$scope.fields.captcha,
$scope.fields.captcha
).then(success).catch(error);
};

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"browserdetection": "0.3.*",
"bc-qr-reader": "0.2.*",
"bootstrap-sass": "3.3.*",
"blockchain-wallet": "3.13.*",
"blockchain-wallet": "3.14.*",
"bc-phone-number": "5.0.*"
},
"devDependencies": {},
Expand Down
43 changes: 19 additions & 24 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = function(config){
exclude: ['assets/js/my_wallet/'],

files : [
'build/js/polyfill.js',
'bower_components/angular/angular.js',
'bower_components/angular-sanitize/angular-sanitize.js',
'bower_components/angular-mocks/angular-mocks.js',
Expand All @@ -21,21 +22,19 @@ module.exports = function(config){
'bower_components/qrcode/lib/qrcode.min.js',
'bower_components/angular-qr/angular-qr.min.js',
'bower_components/angular-inview/angular-inview.js',
'build/js/browser-polyfill.js',
'bower_components/browserdetection/src/browser-detection.js',
'assets/js/app.js',
'assets/js/core/core.module.js',
'build/js/templates.js',
'assets/js/controllers/**/*.controller.js',
'assets/js/filters.js',
'assets/js/services/**/*.service.js',
'assets/js/directives/*.js',
'assets/js/directives/*.directive.js',
'assets/js/core/*.js',
'tests/mocks/**/*.coffee',
'tests/*.coffee',
'tests/controllers/**/*.coffee',
'tests/directives/*.coffee',
'tests/filters/*.coffee',
'tests/services/**/*.coffee',
'tests/controllers/*.coffee',
'tests/directives/*.coffee',
'tests/mocks/**/*.coffee',
'tests/**/*.js',
'app/templates/*.jade',
'bower_components/angular-password-entropy/password-entropy.js',
Expand All @@ -46,16 +45,13 @@ module.exports = function(config){
preprocessors: {
'**/*.jade': ['ng-jade2js'],
'assets/js/core/core.module.js': ['babel'],
'assets/js/controllers/**/*.js' : ['coverage'],
'assets/js/filters.js' : ['coverage'],
'assets/js/services/*.js.coffee' : ['coffee','coverage'],
'assets/js/services/*.service.js' : ['coverage'],
'assets/js/directives/*.js.coffee' : ['coffee','coverage'],
'assets/js/directives/*.js' : ['coverage'],
'assets/js/controllers/**/*.js' : ['coverage', 'babel'],
'assets/js/filters.js' : ['babel', 'coverage'],
'assets/js/services/*.service.js' : ['babel', 'coverage'],
'assets/js/directives/*.directive.js' : ['babel', 'coverage'],
'assets/js/core/*.service.js': ['babel'],
'assets/js/my_wallet.js.coffee': ['coffee'],
'assets/js/routes.js' : ['coverage'],
'assets/js/app.js' : ['coverage'],
'assets/js/routes.js' : ['babel', 'coverage'],
'assets/js/app.js' : ['babel'],
'tests/**/*.coffee' : ['coffee'],
'tests/**/*.js' : ['babel']
},
Expand All @@ -72,6 +68,7 @@ module.exports = function(config){
},
babelPreprocessor: {
options: {
presets: ['es2015'],
sourceMap: 'inline'
},
filename: function (file) {
Expand All @@ -81,7 +78,6 @@ module.exports = function(config){
return file.originalPath;
}
},

ngJade2JsPreprocessor: {
stripPrefix: 'app/',
prependPrefix: '',
Expand Down Expand Up @@ -117,21 +113,20 @@ module.exports = function(config){

coverageReporter: {
reporters: [
{ type : 'html', dir : 'coverage/'},
{ type : 'lcov', dir : 'coverage-lcov/'}
// Fails with: TypeError: Cannot read property 'text' of undefined
// { type : 'html', dir : 'coverage/'},
{ type : 'lcovonly', dir : 'coverage-lcov/'}
],

subdir: '.',

instrumenters: { isparta : require('isparta') },
instrumenters: { isparta : require('isparta')},

instrumenter: {
'**/*.js': 'isparta'
'**/*.js' : 'isparta'
}
}



}
}

if(process.env.TRAVIS) {
Expand Down
30 changes: 17 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,24 @@
"description": "AngularJS front-end to My-Wallet-V3.",
"dependencies": {},
"devDependencies": {
"babel-polyfill": "^6.6.1",
"babel-preset-es2015": "^6.6.0",
"bower": "^1.3.1",
"coffee-script": "^1.9.1",
"ejs": "~0.8.4",
"express": "^4.13.3",
"git-changelog": "^0.1.8",
"grunt": "^0.4.5",
"grunt-autoprefixer": "^3.0.0",
"grunt-babel": "^5.0.1",
"grunt-babel": "^6.0.*",
"grunt-cli": "^0.1.13",
"grunt-concat-css": "^0.3.1",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-concat": "^0.5.0",
"grunt-contrib-concat": "1.0.*",
"grunt-contrib-copy": "^0.7.0",
"grunt-contrib-jade": "^0.14.1",
"grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-uglify": "^0.7.0",
"grunt-contrib-uglify": "1.0.*",
"grunt-contrib-watch": "^0.6.1",
"grunt-html2js": "^0.2.9",
"grunt-karma-coveralls": "^2.5.4",
Expand All @@ -32,19 +34,21 @@
"grunt-shell": "^1.1.1",
"grunt-surround": "^0.1.0",
"grunt-text-replace": "^0.4.0",
"isparta": "^3.0.4",
"istanbul": "^0.3.19",
"isparta": "4.0.*",
"istanbul": "^1.0.0-alpha.2",
"jade": "*",
"karma": "^0.12.16",
"karma-babel-preprocessor": "^5.2.2",
"karma-coffee-preprocessor": "^0.2.1",
"karma-coverage": "^0.5.1",
"jasmine-core": "2.4.*",
"karma": "0.13.*",
"karma-babel-preprocessor": "6.0.*",
"karma-coffee-preprocessor": "0.3.*",
"karma-coverage": "0.5.*",
"karma-jade-preprocessor": "0.0.11",
"karma-jasmine": "^0.2.0",
"karma-jasmine": "0.3.*",
"karma-ng-jade2js-preprocessor": "^0.1.5",
"karma-osx-reporter": "^0.1.0",
"karma-phantomjs-launcher": "^0.1.4",
"karma-osx-reporter": "^0.2.0",
"karma-phantomjs-launcher": "1.0.*",
"node-env-file": "^0.1.4",
"phantomjs-prebuilt": "2.1.*",
"shelljs": "^0.3.0"
},
"scripts": {
Expand All @@ -56,7 +60,7 @@
"build": "node_modules/grunt-cli/bin/grunt build"
},
"engines": {
"node": "0.10.x"
"node": "5.10.x"
},
"repository": {
"type": "git",
Expand Down
1 change: 0 additions & 1 deletion tests/controllers/confirm_recovery_phrase_ctrl_spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ describe "ConfirmRecoveryPhraseCtrl", ->
)

it "should verify", inject((Wallet) ->

for word in scope.words
word.value = word.actual

Expand Down
9 changes: 8 additions & 1 deletion tests/controllers/login_ctrl_spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,23 @@ describe "LoginCtrl", ->
spyOn(Alerts, 'displayError')
spyOn(Alerts, 'displayWarning')


it "should warn against an unknown browser", ->
spyOn(window, "browserDetection").and.returnValue {version: 1, browser: "Random"}

scope.displayBrowserWarning('netscape')
expect(Alerts.displayWarning).toHaveBeenCalledWith('UNKNOWN_BROWSER')

it "should warn against IE", ->
spyOn(window, "browserDetection").and.returnValue {version: 11, browser: "ie"}

scope.displayBrowserWarning('ie')
expect(Alerts.displayWarning).toHaveBeenCalledWith('WARN_AGAINST_IE')

it "should show an error when below minimum version", ->
scope.displayBrowserWarning('firefox')
spyOn(window, "browserDetection").and.returnValue {version: 10, browser: "Chrome"}

scope.displayBrowserWarning('chrome')
expect(scope.disableLogin).toBe(true)
expect(Alerts.displayError).toHaveBeenCalledWith('MINIMUM_BROWSER')

Expand Down
2 changes: 2 additions & 0 deletions tests/controllers/upgrade_ctrl_spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ describe "UpgradeCtrl", ->
describe "goToBlockchain function", ->

it "sets a window location", inject(($window) ->
# This wreaks havoc in the rest of the test suite
pending()
scope.goToBlockchain()
expect($window.location).toBeDefined()
)
1 change: 0 additions & 1 deletion tests/directives/activity-feed_spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ describe "Activity Feed directive", ->

it "has no loading state once transactions have loaded", ->
# need to stub out the Activity service
pending()
scope.status.didLoadTransactions = true
scope.$apply()
expect(scope.loading).toBe(false)
2 changes: 1 addition & 1 deletion tests/directives/block-tor_spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe "TOR Directive", ->
isoScope = undefined

beforeEach module("walletApp")

beforeEach inject((_$compile_, _$rootScope_, Wallet) ->

$compile = _$compile_
Expand Down
2 changes: 1 addition & 1 deletion tests/directives/blocket-loading_spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ describe "Blocket loading directive", ->
$timeout.flush()
expect(isoScope.liftoff).toBe(true)
expect(isoScope.orbiting).toBe(true)
)
)
7 changes: 3 additions & 4 deletions tests/directives/imported-address.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe "Imported Address Directive", ->
legacyAddresses

Wallet.changeLegacyAddressLabel = (address, label, success, error) ->
if label
if label
success()
else
error()
Expand Down Expand Up @@ -69,12 +69,12 @@ describe "Imported Address Directive", ->
expect(isoScope.status.edit).toBe(false)

describe "showAddress", ->

it "should open a modal", inject(($uibModal) ->
spyOn($uibModal, 'open')
isoScope.showAddress()
expect($uibModal.open).toHaveBeenCalled()
)
)

describe "transfer", ->

Expand All @@ -91,4 +91,3 @@ describe "Imported Address Directive", ->
isoScope.showPrivKey()
expect($uibModal.open).toHaveBeenCalled()
)

4 changes: 2 additions & 2 deletions tests/directives/label-origin_spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe "Label Origin Directive", ->
Wallet = undefined

beforeEach module("walletApp")

beforeEach inject((_$compile_, _$rootScope_, Wallet) ->

$compile = _$compile_
Expand Down Expand Up @@ -44,7 +44,7 @@ describe "Label Origin Directive", ->
expect(final).toBe(95)

it "should return undefined if no balance is passed", ->
final = isoScope.determineAvailableBalance()
final = isoScope.determineAvailableBalance()
expect(final).toBeUndefined()

describe "determineLabel function", ->
Expand Down
7 changes: 4 additions & 3 deletions tests/directives/scroll-in-view_spec.coffee
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
describe "Scroll in View Directive", ->

$compile = undefined
$rootScope = undefined
element = undefined
isoScope = undefined

beforeEach module("walletApp")

beforeEach inject((_$compile_, _$rootScope_, Wallet) ->

$compile = _$compile_
Expand Down Expand Up @@ -43,14 +44,14 @@ describe "Scroll in View Directive", ->
isoScope.onScroll(bottom, top)

expect(isoScope.isActive).toBeFalsy()


it "should be active when the element is visible", ->
bottom = 1500
top = 1000
isoScope.onScroll(bottom, top)

expect(isoScope.isActive).toBeTruthy()


return
2 changes: 1 addition & 1 deletion tests/directives/transaction-note_spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe "Transaction Note Directive", ->

# Load the myApp module, which contains the directive
beforeEach module("walletApp")

# Store references to $rootScope and $compile
# so they are available to all tests in this describe block
beforeEach inject((_$compile_, _$rootScope_) ->
Expand Down
2 changes: 1 addition & 1 deletion tests/directives/transaction_description_spec.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe "Transaction Description Directive", ->
describe "Transaction Description Directive", ->
$compile = undefined
$rootScope = undefined
element = undefined
Expand Down
2 changes: 1 addition & 1 deletion tests/directives/transform-currency_spec.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe "Transform-Currency Directive", ->

scope = undefined
isoScope = undefined
element = undefined
Expand Down
Loading

0 comments on commit 63da637

Please sign in to comment.