diff options
27 files changed, 121 insertions, 138 deletions
diff --git a/gui/gulpfile.js b/gui/gulpfile.js index 5492cdc736..f203fc16d0 100644 --- a/gui/gulpfile.js +++ b/gui/gulpfile.js @@ -6,7 +6,7 @@ const assets = require('./tasks/assets'); const watch = require('./tasks/watch'); const dist = require('./tasks/distribution'); -task('clean', function(done) { +task('clean', function (done) { rimraf('./build', done); }); task('build', series('clean', assets.copyAll, scripts.build)); diff --git a/gui/package-lock.json b/gui/package-lock.json index 206d69dfaa..936569ea76 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -5107,9 +5107,9 @@ "dev": true }, "gettext-extractor": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/gettext-extractor/-/gettext-extractor-3.5.1.tgz", - "integrity": "sha512-cyDkswUvBBBy3yzIYiNbIVzAloFXx0vzZjOa9aPDBNviYg1ekM49hMtd7ttCQ/RB4fb+EZm4yyp3pr9jOhG3SA==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/gettext-extractor/-/gettext-extractor-3.5.2.tgz", + "integrity": "sha512-4fJViJvAkWBUV8BHwAaY2T1oirsIEAYgYfYm/+x/gF2xWxOXgn4f7Cjsdq+xuuoA9HZga+fx2PIDP+07zbmP6g==", "dev": true, "requires": { "@types/glob": "5 - 7", @@ -5122,28 +5122,28 @@ }, "dependencies": { "parse5": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.0.tgz", - "integrity": "sha512-fxNG2sQjHvlVAYmzBZS9YlDp6PTSSDwa98vkD4QgVDDCAo84z5X1t5XyJQ62ImdLXx5NdIIfihey6xpum9/gRQ==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", "dev": true } } }, "gettext-parser": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/gettext-parser/-/gettext-parser-4.0.1.tgz", - "integrity": "sha512-ny1f9saN1xnhto5UzDOp7djJy7NbK6ebDAmOFXwp0DDu5KkQ5u3WF6giFU3BXHVqkS+3bxjXS1AmSUbX64fblA==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/gettext-parser/-/gettext-parser-4.0.3.tgz", + "integrity": "sha512-FGzzgAtSJuhFZGKNlV8AGjuBic1MoJXL2hlfS55JlCeMgyvG5XbY/Zje/Cx78gnLh+oO8WMIHp6kh7/j3CLx9A==", "requires": { "content-type": "^1.0.4", "encoding": "^0.1.12", - "readable-stream": "^3.4.0", + "readable-stream": "^3.6.0", "safe-buffer": "^5.2.0" }, "dependencies": { "readable-stream": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", - "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -8239,9 +8239,9 @@ "dev": true }, "prettier": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", - "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.4.tgz", + "integrity": "sha512-SVJIQ51spzFDvh4fIbCLvciiDMCrRhlN3mbZvv/+ycjvmF5E73bKdGfU8QDLNmjYJf+lsGnDBC4UUnvTe5OO0w==", "dev": true }, "prettier-linter-helpers": { diff --git a/gui/package.json b/gui/package.json index 5b3eb3e8f0..a66eaae045 100644 --- a/gui/package.json +++ b/gui/package.json @@ -16,7 +16,7 @@ "connected-react-router": "^5.0.1", "d3-geo-projection": "^2.7.0", "electron-log": "^4.1.1", - "gettext-parser": "^4.0.1", + "gettext-parser": "^4.0.3", "history": "^4.6.1", "jsonrpc-lite": "^2.0.7", "mkdirp": "^1.0.3", @@ -77,11 +77,11 @@ "eslint": "^6.8.0", "eslint-plugin-prettier": "^3.1.2", "eslint-plugin-react": "^7.18.3", - "gettext-extractor": "^3.5.1", + "gettext-extractor": "^3.5.2", "gulp": "^4.0.2", "gulp-inject-string": "^1.1.2", "gulp-typescript": "^5.0.1", - "prettier": "1.19.1", + "prettier": "2.0.4", "rimraf": "^2.7.1", "sinon": "^7.1.1", "ts-node": "^8.3.0", diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts index 2c3d71e628..7b63b11a28 100644 --- a/gui/src/main/index.ts +++ b/gui/src/main/index.ts @@ -1185,11 +1185,7 @@ class ApplicationMain { accountExpiry && !accountExpiry.hasExpired() && !this.accountExpiryNotificationTimeout && - accountExpiry.willHaveExpiredAt( - moment() - .add(3, 'days') - .toDate(), - ) + accountExpiry.willHaveExpiredAt(moment().add(3, 'days').toDate()) ) { this.notificationController.closeToExpiryNotification(accountExpiry); this.accountExpiryNotificationTimeout = global.setTimeout(() => { diff --git a/gui/src/renderer/components/Account.tsx b/gui/src/renderer/components/Account.tsx index 18147ef265..f0cbbe0495 100644 --- a/gui/src/renderer/components/Account.tsx +++ b/gui/src/renderer/components/Account.tsx @@ -30,8 +30,10 @@ export default class Account extends Component<IProps> { <NavigationBar> <NavigationItems> <BackBarItem action={this.props.onClose}> - {// TRANSLATORS: Back button in navigation bar - messages.pgettext('navigation-bar', 'Settings')} + { + // TRANSLATORS: Back button in navigation bar + messages.pgettext('navigation-bar', 'Settings') + } </BackBarItem> </NavigationItems> </NavigationBar> diff --git a/gui/src/renderer/components/AdvancedSettings.tsx b/gui/src/renderer/components/AdvancedSettings.tsx index 27d4043d7c..d5ffe6e041 100644 --- a/gui/src/renderer/components/AdvancedSettings.tsx +++ b/gui/src/renderer/components/AdvancedSettings.tsx @@ -129,12 +129,16 @@ export default class AdvancedSettings extends Component<IProps> { <NavigationBar> <NavigationItems> <BackBarItem action={this.props.onClose}> - {// TRANSLATORS: Back button in navigation bar - messages.pgettext('navigation-bar', 'Settings')} + { + // TRANSLATORS: Back button in navigation bar + messages.pgettext('navigation-bar', 'Settings') + } </BackBarItem> <TitleBarItem> - {// TRANSLATORS: Title label in navigation bar - messages.pgettext('advanced-settings-nav', 'Advanced')} + { + // TRANSLATORS: Title label in navigation bar + messages.pgettext('advanced-settings-nav', 'Advanced') + } </TitleBarItem> </NavigationItems> </NavigationBar> @@ -242,13 +246,9 @@ export default class AdvancedSettings extends Component<IProps> { value={this.props.openvpn.port} onSelect={this.onSelectOpenVpnPort} /> - ) : ( - undefined - )} + ) : undefined} </View> - ) : ( - undefined - )} + ) : undefined} {this.props.tunnelProtocol === 'wireguard' ? ( <View style={styles.advanced_settings__content}> @@ -260,9 +260,7 @@ export default class AdvancedSettings extends Component<IProps> { onSelect={this.onSelectWireguardPort} /> </View> - ) : ( - undefined - )} + ) : undefined} <Selector title={ diff --git a/gui/src/renderer/components/ErrorBoundary.tsx b/gui/src/renderer/components/ErrorBoundary.tsx index 443eb6943a..18ac8f7d03 100644 --- a/gui/src/renderer/components/ErrorBoundary.tsx +++ b/gui/src/renderer/components/ErrorBoundary.tsx @@ -55,8 +55,9 @@ export default class ErrorBoundary extends Component<IProps, IState> { this.setState({ hasError: true }); log.error( - `The error boundary caught an error: ${error.message}\nError stack: ${error.stack || - 'Not available'}\nComponent stack: ${info.componentStack}`, + `The error boundary caught an error: ${error.message}\nError stack: ${ + error.stack || 'Not available' + }\nComponent stack: ${info.componentStack}`, ); } diff --git a/gui/src/renderer/components/NotificationArea.tsx b/gui/src/renderer/components/NotificationArea.tsx index 678341f079..812e686f69 100644 --- a/gui/src/renderer/components/NotificationArea.tsx +++ b/gui/src/renderer/components/NotificationArea.tsx @@ -183,14 +183,7 @@ export default class NotificationArea extends Component<IProps, State> { }; } - if ( - accountExpiry && - accountExpiry.willHaveExpiredAt( - moment() - .add(3, 'days') - .toDate(), - ) - ) { + if (accountExpiry && accountExpiry.willHaveExpiredAt(moment().add(3, 'days').toDate())) { return { visible: true, type: 'expires-soon', diff --git a/gui/src/renderer/components/Preferences.tsx b/gui/src/renderer/components/Preferences.tsx index 54d492ce7e..dc80143fc9 100644 --- a/gui/src/renderer/components/Preferences.tsx +++ b/gui/src/renderer/components/Preferences.tsx @@ -43,12 +43,16 @@ export default class Preferences extends Component<IProps> { <NavigationBar> <NavigationItems> <BackBarItem action={this.props.onClose}> - {// TRANSLATORS: Back button in navigation bar - messages.pgettext('navigation-bar', 'Settings')} + { + // TRANSLATORS: Back button in navigation bar + messages.pgettext('navigation-bar', 'Settings') + } </BackBarItem> <TitleBarItem> - {// TRANSLATORS: Title label in navigation bar - messages.pgettext('preferences-nav', 'Preferences')} + { + // TRANSLATORS: Title label in navigation bar + messages.pgettext('preferences-nav', 'Preferences') + } </TitleBarItem> </NavigationItems> </NavigationBar> @@ -159,9 +163,7 @@ export default class Preferences extends Component<IProps> { </Cell.FooterText> </Cell.Footer> </React.Fragment> - ) : ( - undefined - )} + ) : undefined} <Cell.Container> <Cell.Label> diff --git a/gui/src/renderer/components/SelectLanguage.tsx b/gui/src/renderer/components/SelectLanguage.tsx index 7af49d76a8..254272cc46 100644 --- a/gui/src/renderer/components/SelectLanguage.tsx +++ b/gui/src/renderer/components/SelectLanguage.tsx @@ -71,12 +71,16 @@ export default class SelectLanguage extends Component<IProps, IState> { <NavigationBar> <NavigationItems> <BackBarItem action={this.props.onClose}> - {// TRANSLATORS: Back button in navigation bar - messages.pgettext('navigation-bar', 'Settings')} + { + // TRANSLATORS: Back button in navigation bar + messages.pgettext('navigation-bar', 'Settings') + } </BackBarItem> <TitleBarItem> - {// TRANSLATORS: Title label in navigation bar - messages.pgettext('select-language-nav', 'Select language')} + { + // TRANSLATORS: Title label in navigation bar + messages.pgettext('select-language-nav', 'Select language') + } </TitleBarItem> </NavigationItems> </NavigationBar> diff --git a/gui/src/renderer/components/SelectLocation.tsx b/gui/src/renderer/components/SelectLocation.tsx index 68ca5db8db..8ea980a5ae 100644 --- a/gui/src/renderer/components/SelectLocation.tsx +++ b/gui/src/renderer/components/SelectLocation.tsx @@ -93,8 +93,10 @@ export default class SelectLocation extends Component<IProps> { <NavigationItems> <CloseBarItem action={this.props.onClose} /> <TitleBarItem> - {// TRANSLATORS: Title label in navigation bar - messages.pgettext('select-location-nav', 'Select location')} + { + // TRANSLATORS: Title label in navigation bar + messages.pgettext('select-location-nav', 'Select location') + } </TitleBarItem> </NavigationItems> <View style={styles.navigationBarAttachment}> diff --git a/gui/src/renderer/components/Settings.tsx b/gui/src/renderer/components/Settings.tsx index f1e1893646..eb12187dc9 100644 --- a/gui/src/renderer/components/Settings.tsx +++ b/gui/src/renderer/components/Settings.tsx @@ -51,8 +51,10 @@ export default class Settings extends Component<IProps> { <NavigationItems> <CloseBarItem action={this.props.onClose} /> <TitleBarItem> - {// TRANSLATORS: Title label in navigation bar - messages.pgettext('navigation-bar', 'Settings')} + { + // TRANSLATORS: Title label in navigation bar + messages.pgettext('navigation-bar', 'Settings') + } </TitleBarItem> </NavigationItems> </NavigationBar> @@ -113,8 +115,10 @@ export default class Settings extends Component<IProps> { <View> <Cell.CellButton onPress={this.props.onViewAccount}> <Cell.Label> - {// TRANSLATORS: Navigation button to the 'Account' view - messages.pgettext('settings-view', 'Account')} + { + // TRANSLATORS: Navigation button to the 'Account' view + messages.pgettext('settings-view', 'Account') + } </Cell.Label> <Cell.SubText style={isOutOfTime ? styles.accountPaidUntilErrorLabel : undefined}> {isOutOfTime ? outOfTimeMessage : formattedExpiry} @@ -125,16 +129,20 @@ export default class Settings extends Component<IProps> { <Cell.CellButton onPress={this.props.onViewPreferences}> <Cell.Label> - {// TRANSLATORS: Navigation button to the 'Preferences' view - messages.pgettext('settings-view', 'Preferences')} + { + // TRANSLATORS: Navigation button to the 'Preferences' view + messages.pgettext('settings-view', 'Preferences') + } </Cell.Label> <Cell.Icon height={12} width={7} source="icon-chevron" /> </Cell.CellButton> <Cell.CellButton onPress={this.props.onViewAdvancedSettings}> <Cell.Label> - {// TRANSLATORS: Navigation button to the 'Advanced' settings view - messages.pgettext('settings-view', 'Advanced')} + { + // TRANSLATORS: Navigation button to the 'Advanced' settings view + messages.pgettext('settings-view', 'Advanced') + } </Cell.Label> <Cell.Icon height={12} width={7} source="icon-chevron" /> </Cell.CellButton> @@ -189,16 +197,20 @@ export default class Settings extends Component<IProps> { <View> <Cell.CellButton onPress={this.props.onViewSupport}> <Cell.Label> - {// TRANSLATORS: Navigation button to the 'Report a problem' help view - messages.pgettext('settings-view', 'Report a problem')} + { + // TRANSLATORS: Navigation button to the 'Report a problem' help view + messages.pgettext('settings-view', 'Report a problem') + } </Cell.Label> <Cell.Icon height={12} width={7} source="icon-chevron" /> </Cell.CellButton> <Cell.CellButton disabled={this.props.isOffline} onPress={this.openFaqLink}> <Cell.Label> - {// TRANSLATORS: Link to the webpage - messages.pgettext('settings-view', 'FAQs & Guides')} + { + // TRANSLATORS: Link to the webpage + messages.pgettext('settings-view', 'FAQs & Guides') + } </Cell.Label> <Cell.Icon height={16} width={16} source="icon-extLink" /> </Cell.CellButton> @@ -206,8 +218,10 @@ export default class Settings extends Component<IProps> { <Cell.CellButton onPress={this.props.onViewSelectLanguage}> <Cell.UntintedIcon width={24} height={24} source="icon-language" /> <Cell.Label> - {// TRANSLATORS: Navigation button to the 'Language' settings view - messages.pgettext('settings-view', 'Language')} + { + // TRANSLATORS: Navigation button to the 'Language' settings view + messages.pgettext('settings-view', 'Language') + } </Cell.Label> <Cell.SubText>{this.props.preferredLocaleDisplayName}</Cell.SubText> <Cell.Icon height={12} width={7} source="icon-chevron" /> diff --git a/gui/src/renderer/components/Support.tsx b/gui/src/renderer/components/Support.tsx index 18ef6627ac..5f9a6db8a4 100644 --- a/gui/src/renderer/components/Support.tsx +++ b/gui/src/renderer/components/Support.tsx @@ -136,8 +136,10 @@ export default class Support extends Component<ISupportProps, ISupportState> { <NavigationBar> <NavigationItems> <BackBarItem action={this.props.onClose}> - {// TRANSLATORS: Back button in navigation bar - messages.pgettext('navigation-bar', 'Settings')} + { + // TRANSLATORS: Back button in navigation bar + messages.pgettext('navigation-bar', 'Settings') + } </BackBarItem> </NavigationItems> </NavigationBar> diff --git a/gui/src/renderer/components/WireguardKeys.tsx b/gui/src/renderer/components/WireguardKeys.tsx index 2a589890e7..2f17ff19bc 100644 --- a/gui/src/renderer/components/WireguardKeys.tsx +++ b/gui/src/renderer/components/WireguardKeys.tsx @@ -63,8 +63,10 @@ export default class WireguardKeys extends Component<IProps, IState> { <NavigationBar> <NavigationItems> <BackBarItem action={this.props.onClose}> - {// TRANSLATORS: Back button in navigation bar - messages.pgettext('wireguard-keys-nav', 'Advanced')} + { + // TRANSLATORS: Back button in navigation bar + messages.pgettext('wireguard-keys-nav', 'Advanced') + } </BackBarItem> </NavigationItems> </NavigationBar> diff --git a/gui/src/renderer/containers/SelectLocationPage.tsx b/gui/src/renderer/containers/SelectLocationPage.tsx index c52dd4fd31..2c0d29c8ee 100644 --- a/gui/src/renderer/containers/SelectLocationPage.tsx +++ b/gui/src/renderer/containers/SelectLocationPage.tsx @@ -54,9 +54,7 @@ const mapDispatchToProps = (dispatch: ReduxDispatch, props: IAppContext) => { history.goBack(); try { - const relayUpdate = RelaySettingsBuilder.normal() - .location.fromRaw(relayLocation) - .build(); + const relayUpdate = RelaySettingsBuilder.normal().location.fromRaw(relayLocation).build(); await props.app.updateRelaySettings(relayUpdate); await props.app.connectTunnel(); diff --git a/gui/src/renderer/lib/account.ts b/gui/src/renderer/lib/account.ts index c862d84416..0909b9670b 100644 --- a/gui/src/renderer/lib/account.ts +++ b/gui/src/renderer/lib/account.ts @@ -1,8 +1,5 @@ export function formatAccountToken(accountToken: string) { const parts = - accountToken - .replace(/\s+| /g, '') - .substring(0, 16) - .match(new RegExp('.{1,4}', 'g')) || []; + accountToken.replace(/\s+| /g, '').substring(0, 16).match(new RegExp('.{1,4}', 'g')) || []; return parts.join(' '); } diff --git a/gui/src/renderer/redux/account/reducers.ts b/gui/src/renderer/redux/account/reducers.ts index f429192de5..bf2a87c6b5 100644 --- a/gui/src/renderer/redux/account/reducers.ts +++ b/gui/src/renderer/redux/account/reducers.ts @@ -20,7 +20,7 @@ const initialState: IAccountReduxState = { status: { type: 'none' }, }; -export default function( +export default function ( state: IAccountReduxState = initialState, action: ReduxAction, ): IAccountReduxState { diff --git a/gui/src/renderer/redux/connection/reducers.ts b/gui/src/renderer/redux/connection/reducers.ts index e7f2f0c2cf..48a8f3f37f 100644 --- a/gui/src/renderer/redux/connection/reducers.ts +++ b/gui/src/renderer/redux/connection/reducers.ts @@ -27,7 +27,7 @@ const initialState: IConnectionReduxState = { city: undefined, }; -export default function( +export default function ( state: IConnectionReduxState = initialState, action: ReduxAction, ): IConnectionReduxState { diff --git a/gui/src/renderer/redux/settings/reducers.ts b/gui/src/renderer/redux/settings/reducers.ts index d74cbd3b4f..3cfb414a42 100644 --- a/gui/src/renderer/redux/settings/reducers.ts +++ b/gui/src/renderer/redux/settings/reducers.ts @@ -175,7 +175,7 @@ const initialState: ISettingsReduxState = { }, }; -export default function( +export default function ( state: ISettingsReduxState = initialState, action: ReduxAction, ): ISettingsReduxState { diff --git a/gui/src/renderer/redux/support/reducers.ts b/gui/src/renderer/redux/support/reducers.ts index 7a300cf2ca..94ed2a9123 100644 --- a/gui/src/renderer/redux/support/reducers.ts +++ b/gui/src/renderer/redux/support/reducers.ts @@ -10,7 +10,7 @@ const initialState: ISupportReduxState = { message: '', }; -export default function( +export default function ( state: ISupportReduxState = initialState, action: ReduxAction, ): ISupportReduxState { diff --git a/gui/src/renderer/redux/userinterface/reducers.ts b/gui/src/renderer/redux/userinterface/reducers.ts index 7941d6001b..62231aafaf 100644 --- a/gui/src/renderer/redux/userinterface/reducers.ts +++ b/gui/src/renderer/redux/userinterface/reducers.ts @@ -18,7 +18,7 @@ const initialState: IUserInterfaceReduxState = { locationScope: LocationScope.relay, }; -export default function( +export default function ( state: IUserInterfaceReduxState = initialState, action: ReduxAction, ): IUserInterfaceReduxState { diff --git a/gui/src/renderer/redux/version/reducers.ts b/gui/src/renderer/redux/version/reducers.ts index 21de2bf2d8..9932628e02 100644 --- a/gui/src/renderer/redux/version/reducers.ts +++ b/gui/src/renderer/redux/version/reducers.ts @@ -18,7 +18,7 @@ const initialState: IVersionReduxState = { consistent: true, }; -export default function( +export default function ( state: IVersionReduxState = initialState, action: ReduxAction, ): IVersionReduxState { diff --git a/gui/tasks/hotreload.js b/gui/tasks/hotreload.js index ad6bb9ae01..58114e1082 100644 --- a/gui/tasks/hotreload.js +++ b/gui/tasks/hotreload.js @@ -14,7 +14,7 @@ function startBrowserSync(done) { notify: false, logSnippet: false, }, - function(error, bs) { + function (error, bs) { done(error); }, ); diff --git a/gui/tasks/scripts.js b/gui/tasks/scripts.js index e97b9f0ffd..4e54395259 100644 --- a/gui/tasks/scripts.js +++ b/gui/tasks/scripts.js @@ -4,7 +4,7 @@ const inject = require('gulp-inject-string'); const TscWatchClient = require('tsc-watch/client'); function makeWatchCompiler(onFirstSuccess) { - const compileScripts = function() { + const compileScripts = function () { const watch = new TscWatchClient(); watch.on('first_success', onFirstSuccess); watch.start('--noClear', '--sourceMap', '--project', '.'); diff --git a/gui/test/components/NotificationArea.spec.tsx b/gui/test/components/NotificationArea.spec.tsx index a0732400da..7be9de56e1 100644 --- a/gui/test/components/NotificationArea.spec.tsx +++ b/gui/test/components/NotificationArea.spec.tsx @@ -15,12 +15,7 @@ describe('components/NotificationArea', () => { latestStable: '2018.2', }; - const defaultExpiry = new AccountExpiry( - moment() - .add(1, 'year') - .format(), - 'en', - ); + const defaultExpiry = new AccountExpiry(moment().add(1, 'year').format(), 'en'); it('handles disconnecting state', () => { for (const reason of ['nothing', 'block'] as AfterDisconnect[]) { @@ -260,12 +255,7 @@ describe('components/NotificationArea', () => { }); it('handles time running low', () => { - const expiry = new AccountExpiry( - moment() - .add(2, 'days') - .format(), - 'en', - ); + const expiry = new AccountExpiry(moment().add(2, 'days').format(), 'en'); const component = shallow( <NotificationArea tunnelState={{ diff --git a/gui/test/keyframe-animation.spec.ts b/gui/test/keyframe-animation.spec.ts index 11eeaf0c54..e3d6e417b0 100644 --- a/gui/test/keyframe-animation.spec.ts +++ b/gui/test/keyframe-animation.spec.ts @@ -2,7 +2,7 @@ import { expect } from 'chai'; import { it, describe } from 'mocha'; import KeyframeAnimation from '../src/main/keyframe-animation'; -describe('lib/keyframe-animation', function() { +describe('lib/keyframe-animation', function () { this.timeout(1000); const newAnimation = () => { diff --git a/gui/test/relay-settings-builder.spec.ts b/gui/test/relay-settings-builder.spec.ts index 009ddfa301..f669d43d2b 100644 --- a/gui/test/relay-settings-builder.spec.ts +++ b/gui/test/relay-settings-builder.spec.ts @@ -4,11 +4,7 @@ import RelaySettingsBuilder from '../src/shared/relay-settings-builder'; describe('Relay settings builder', () => { it('should set location to any', () => { - expect( - RelaySettingsBuilder.normal() - .location.any() - .build(), - ).to.deep.equal({ + expect(RelaySettingsBuilder.normal().location.any().build()).to.deep.equal({ normal: { location: 'any', }, @@ -16,11 +12,7 @@ describe('Relay settings builder', () => { }); it('should bound location to city', () => { - expect( - RelaySettingsBuilder.normal() - .location.city('se', 'mma') - .build(), - ).to.deep.equal({ + expect(RelaySettingsBuilder.normal().location.city('se', 'mma').build()).to.deep.equal({ normal: { location: { only: { @@ -32,11 +24,7 @@ describe('Relay settings builder', () => { }); it('should bound location to country', () => { - expect( - RelaySettingsBuilder.normal() - .location.country('se') - .build(), - ).to.deep.equal({ + expect(RelaySettingsBuilder.normal().location.country('se').build()).to.deep.equal({ normal: { location: { only: { country: 'se' }, @@ -80,27 +68,21 @@ describe('Relay settings builder', () => { }); it('should set location from raw RelayLocation', () => { - expect( - RelaySettingsBuilder.normal() - .location.fromRaw('any') - .build(), - ).to.deep.equal({ + expect(RelaySettingsBuilder.normal().location.fromRaw('any').build()).to.deep.equal({ normal: { location: 'any', }, }); - expect( - RelaySettingsBuilder.normal() - .location.fromRaw({ country: 'se' }) - .build(), - ).to.deep.equal({ - normal: { - location: { - only: { country: 'se' }, + expect(RelaySettingsBuilder.normal().location.fromRaw({ country: 'se' }).build()).to.deep.equal( + { + normal: { + location: { + only: { country: 'se' }, + }, }, }, - }); + ); expect( RelaySettingsBuilder.normal() |
