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

Commit

Permalink
Fix require statement in extensionsReducer- rimraf needs to be global…
Browse files Browse the repository at this point in the history
…ly required, not pathed

Also includes:
- move extensionsReducerTest to the browser folder
- fix broken unit tests
  - svg needed stub on windows
  - export HTML had an issue on windows

Auditors: @cezaraugusto
  • Loading branch information
bsclifton committed Apr 10, 2017
1 parent b06c959 commit 61ae1a7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/browser/reducers/extensionsReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const electron = require('electron')
const app = electron.app

const path = require('path')
const rimraf = require('../../../tools/lib/rimraf')
const rimraf = require('rimraf')

const extensionState = require('../../common/state/extensionState')
const ExtensionConstants = require('../../common/constants/extensionConstants')
Expand Down
1 change: 1 addition & 0 deletions test/unit/about/preferencesTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe('Preferences component', function () {
mockery.registerMock('../../../extensions/brave/img/preferences/browser_prefs_general.svg', 'browser_prefs_general.svg')
mockery.registerMock('../../../extensions/brave/img/preferences/browser_prefs_search.svg', 'browser_prefs_search.svg')
mockery.registerMock('../../../extensions/brave/img/preferences/browser_prefs_tabs.svg', 'browser_prefs_tabs.svg')
mockery.registerMock('../../../extensions/brave/img/preferences/browser_prefs_extensions.svg')
mockery.registerMock('../../../extensions/brave/img/preferences/browser_prefs_plugins.svg', 'browser_prefs_plugins.svg')
mockery.registerMock('../../../extensions/brave/img/preferences/browser_prefs_security.svg', 'browser_prefs_security.svg')
mockery.registerMock('../../../extensions/brave/img/preferences/browser_prefs_shields.svg', 'browser_prefs_shields.svg')
Expand Down
7 changes: 5 additions & 2 deletions test/unit/app/browser/exportBookmarksTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ describe('Bookmarks export', function () {
it('generated html', function () {
const personal = exporter.createBookmarkArray(sites)
const other = exporter.createBookmarkArray(sites, -1, false)
const result = exporter.createBookmarkHTML(personal, other)
const expected = fs.readFileSync('./test/fixtures/bookmarkExport.html', 'utf8')
let result = exporter.createBookmarkHTML(personal, other)
let expected = fs.readFileSync('./test/fixtures/bookmarkExport.html', 'utf8')

result = result.replace(/\s+/g,' ')
expected = expected.replace(/\s+/g,' ')

assert.equal(result, expected)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('extensionsReducer', function () {
useCleanCache: true
})
mockery.registerMock('electron', fakeElectron)
mockery.registerMock('../../../tools/lib/rimraf', fakeRimraf)
mockery.registerMock('rimraf', fakeRimraf)
extensionsReducer = require('../../../../../app/browser/reducers/extensionsReducer')
})

Expand Down
1 change: 1 addition & 0 deletions test/unit/app/renderer/paymentsTabTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ describe('PaymentsTab component', function () {
mockery.registerMock('../../../extensions/brave/img/preferences/browser_prefs_general.svg', 'browser_prefs_general.svg')
mockery.registerMock('../../../extensions/brave/img/preferences/browser_prefs_search.svg', 'browser_prefs_search.svg')
mockery.registerMock('../../../extensions/brave/img/preferences/browser_prefs_tabs.svg', 'browser_prefs_tabs.svg')
mockery.registerMock('../../../extensions/brave/img/preferences/browser_prefs_extensions.svg')
mockery.registerMock('../../../extensions/brave/img/preferences/browser_prefs_plugins.svg', 'browser_prefs_plugins.svg')
mockery.registerMock('../../../extensions/brave/img/preferences/browser_prefs_security.svg', 'browser_prefs_security.svg')
mockery.registerMock('../../../extensions/brave/img/preferences/browser_prefs_shields.svg', 'browser_prefs_shields.svg')
Expand Down

0 comments on commit 61ae1a7

Please sign in to comment.