test: there is only --ci (#20794)

This commit is contained in:
Jeremy Apthorp 2019-10-30 16:38:21 -07:00 committed by GitHub
parent b275273044
commit 6781d5e3c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 55 additions and 251 deletions

View file

@ -5,7 +5,6 @@ import * as https from 'https'
import * as net from 'net'
import * as fs from 'fs'
import * as path from 'path'
import { homedir } from 'os'
import split = require('split')
import { app, BrowserWindow, Menu } from 'electron'
import { emittedOnce } from './events-helpers';
@ -129,7 +128,7 @@ describe('app module', () => {
describe('app.getLocaleCountryCode()', () => {
it('should be empty or have length of two', () => {
let expectedLength = 2
if (isCI && process.platform === 'linux') {
if (process.platform === 'linux') {
// Linux CI machines have no locale.
expectedLength = 0
}
@ -143,13 +142,7 @@ describe('app module', () => {
})
})
describe('app.isInApplicationsFolder()', () => {
before(function () {
if (process.platform !== 'darwin') {
this.skip()
}
})
ifdescribe(process.platform === 'darwin')('app.isInApplicationsFolder()', () => {
it('should be false during tests', () => {
expect(app.isInApplicationsFolder()).to.equal(false)
})
@ -679,30 +672,6 @@ describe('app module', () => {
})
})
describe('getPath("logs")', () => {
const logsPaths = {
'darwin': path.resolve(homedir(), 'Library', 'Logs'),
'linux': path.resolve(homedir(), 'AppData', app.name),
'win32': path.resolve(homedir(), 'AppData', app.name),
}
it('has no logs directory by default', () => {
// this won't be deterministic except on CI since
// users may or may not have this dir
if (!isCI) return
const osLogPath = (logsPaths as any)[process.platform]
expect(fs.existsSync(osLogPath)).to.be.false
})
it('creates a new logs directory if one does not exist', () => {
expect(() => { app.getPath('logs') }).to.not.throw()
const osLogPath = (logsPaths as any)[process.platform]
expect(fs.existsSync(osLogPath)).to.be.true
})
})
describe('getPath(name)', () => {
it('returns paths that exist', () => {
const paths = [
@ -729,9 +698,9 @@ describe('app module', () => {
it('does not create a new directory by default', () => {
const badPath = path.join(__dirname, 'music')
expect(fs.existsSync(badPath)).to.be.false
expect(fs.existsSync(badPath)).to.be.false()
app.setPath('music', badPath)
expect(fs.existsSync(badPath)).to.be.false
expect(fs.existsSync(badPath)).to.be.false()
expect(() => { app.getPath(badPath as any) }).to.throw()
})
@ -923,7 +892,8 @@ describe('app module', () => {
})
})
describe('getFileIcon() API', () => {
// FIXME Get these specs running on Linux CI
ifdescribe(process.platform !== 'linux')('getFileIcon() API', () => {
const iconPath = path.join(__dirname, 'fixtures/assets/icon.ico')
const sizes = {
small: 16,
@ -931,15 +901,6 @@ describe('app module', () => {
large: process.platform === 'win32' ? 32 : 48
}
// (alexeykuzmin): `.skip()` called in `before`
// doesn't affect nested `describe`s.
beforeEach(function () {
// FIXME Get these specs running on Linux CI
if (process.platform === 'linux' && isCI) {
this.skip()
}
})
it('fetches a non-empty icon', async () => {
const icon = await app.getFileIcon(iconPath)
expect(icon.isEmpty()).to.equal(false)