Skip to content

Commit

Permalink
Change a bunch of JavaScript files to strict mode. (#1470)
Browse files Browse the repository at this point in the history
  • Loading branch information
NodeGuy authored and fedekunze committed Oct 16, 2018
1 parent 63f8420 commit 47841fd
Show file tree
Hide file tree
Showing 20 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

* Changed minor component of version number to match testnet version. @NodeGuy
* Updated contribution guidelines. @faboweb
* #1183 Changed a bunch of JavaScript files to strict mode. @NodeGuy

### Fixed

Expand Down
2 changes: 2 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict"

module.exports = {
testMatch: [`**/unit/specs/**/*spec.js`],
moduleFileExtensions: [`js`, `vue`],
Expand Down
2 changes: 2 additions & 0 deletions tasks/build/local/build.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict"

const os = require(`os`)
const fs = require(`fs-extra`)
const { cli } = require(`@nodeguy/cli`)
Expand Down
2 changes: 2 additions & 0 deletions tasks/common.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict"

// on windows some processes are not exiting when using child.kill so we use a windows specific comand
module.exports.cleanExitChild = function(child) {
return new Promise(resolve => {
Expand Down
2 changes: 2 additions & 0 deletions tasks/test-build.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict"

const spawn = require(`child_process`).spawn
const { cleanExitChild } = require(`./common.js`)

Expand Down
2 changes: 2 additions & 0 deletions tasks/testnet.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict"

let runDev = require(`./runner.js`)
let config = require(`../app/src/config.js`)

Expand Down
2 changes: 2 additions & 0 deletions tasks/windows-installer.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict"

var electronInstaller = require(`electron-winstaller`)
var { author, version } = require(`../package.json`)

Expand Down
2 changes: 2 additions & 0 deletions test/e2e/common.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict"

function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms))
}
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/init.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict"

let test = require(`tape-promise/tape`)
let fs = require(`fs-extra`)
let { join } = require(`path`)
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/preferences.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict"

let test = require(`tape-promise/tape`)
let { getApp, restart } = require(`./launch.js`)
let {
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/signin.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict"

let test = require(`tape-promise/tape`)
let { getApp, refresh } = require(`./launch.js`)
let { openMenu, login, sleep } = require(`./common.js`)
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/wallet.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict"

let test = require(`tape-promise/tape`)
let { getApp, restart } = require(`./launch.js`)
let {
Expand Down
2 changes: 2 additions & 0 deletions test/unit/helpers/console_error_throw.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict"

if (!process.env.LISTENING_TO_UNHANDLED_REJECTION) {
process.on(`unhandledRejection`, reason => {
throw reason
Expand Down
2 changes: 2 additions & 0 deletions test/unit/helpers/electron_mock.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict"

// this mocks the IPC layer and isolates the mainthread from the renderer thread in tests
jest.mock(`electron`, () => ({
clipboard: { writeText: jest.fn() },
Expand Down
2 changes: 2 additions & 0 deletions test/unit/helpers/fixed_time.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict"

/* globals jest */
require(`moment`)
const mockMomentTz = require(`moment-timezone`)
Expand Down
2 changes: 2 additions & 0 deletions test/unit/helpers/fs-mock.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict"

const { Writable } = require(`stream`)
const { normalize, sep } = require(`path`)

Expand Down
2 changes: 2 additions & 0 deletions test/unit/helpers/node_mock.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict"

let mockValidators = require(`src/helpers/json/mock_validators.json`)
let mockLcd = require(`../../../app/src/renderer/connectors/lcdClientMock.js`)

Expand Down
2 changes: 2 additions & 0 deletions test/unit/specs/App.spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict"

/* mocking electron differently in one file apparently didn't work so I had to split the App tests in 2 files */

jest.mock(
Expand Down
2 changes: 2 additions & 0 deletions test/unit/specs/addressbook.spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict"

const mockFsExtra = require(`../helpers/fs-mock`).default
let Addressbook

Expand Down
2 changes: 2 additions & 0 deletions test/unit/specs/tasks/build.spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict"

// This is necessary because another file corrupts the behavior of Date. We
// really should fix that.
/*global _Date */
Expand Down

0 comments on commit 47841fd

Please sign in to comment.