Explicitly skip tests that should be skipped

This commit is contained in:
Aleksei Kuzmin 2017-11-16 00:05:46 +03:00
parent 42d7d51b75
commit cf749a8e18
19 changed files with 675 additions and 262 deletions

View file

@ -53,6 +53,7 @@ describe('crashReporter module', () => {
})
it('should send minidump when renderer crashes', function (done) {
// TODO(alexeykuzmin): Skip the test instead of marking it as passed.
if (process.env.APPVEYOR === 'True') return done()
if (process.env.TRAVIS === 'true') return done()
@ -72,6 +73,7 @@ describe('crashReporter module', () => {
})
})
it('should send minidump when node processes crash', function (done) {
// TODO(alexeykuzmin): Skip the test instead of marking it as passed.
if (process.env.APPVEYOR === 'True') return done()
if (process.env.TRAVIS === 'true') return done()
@ -165,6 +167,7 @@ describe('crashReporter module', () => {
})
})
it('should send minidump with updated extra parameters', function (done) {
// TODO(alexeykuzmin): Skip the test instead of marking it as passed.
if (process.env.APPVEYOR === 'True') return done()
if (process.env.TRAVIS === 'true') return done()
@ -267,26 +270,34 @@ describe('crashReporter module', () => {
it('throws an error when called from the renderer process', () => {
assert.throws(() => require('electron').crashReporter.getUploadToServer())
})
it('returns true when uploadToServer is set to true', () => {
if (process.platform === 'darwin') {
crashReporter.start({
companyName: 'Umbrella Corporation',
submitURL: 'http://127.0.0.1/crashes',
uploadToServer: true
})
assert.equal(crashReporter.getUploadToServer(), true)
it('returns true when uploadToServer is set to true', function () {
if (process.platform !== 'darwin') {
// FIXME(alexeykuzmin): Skip the test.
// this.skip()
return
}
crashReporter.start({
companyName: 'Umbrella Corporation',
submitURL: 'http://127.0.0.1/crashes',
uploadToServer: true
})
assert.equal(crashReporter.getUploadToServer(), true)
})
it('returns false when uploadToServer is set to false', () => {
if (process.platform === 'darwin') {
crashReporter.start({
companyName: 'Umbrella Corporation',
submitURL: 'http://127.0.0.1/crashes',
uploadToServer: true
})
crashReporter.setUploadToServer(false)
assert.equal(crashReporter.getUploadToServer(), false)
it('returns false when uploadToServer is set to false', function () {
if (process.platform !== 'darwin') {
// FIXME(alexeykuzmin): Skip the test.
// this.skip()
return
}
crashReporter.start({
companyName: 'Umbrella Corporation',
submitURL: 'http://127.0.0.1/crashes',
uploadToServer: true
})
crashReporter.setUploadToServer(false)
assert.equal(crashReporter.getUploadToServer(), false)
})
})
@ -294,27 +305,35 @@ describe('crashReporter module', () => {
it('throws an error when called from the renderer process', () => {
assert.throws(() => require('electron').crashReporter.setUploadToServer('arg'))
})
it('sets uploadToServer false when called with false', () => {
if (process.platform === 'darwin') {
crashReporter.start({
companyName: 'Umbrella Corporation',
submitURL: 'http://127.0.0.1/crashes',
uploadToServer: true
})
crashReporter.setUploadToServer(false)
assert.equal(crashReporter.getUploadToServer(), false)
it('sets uploadToServer false when called with false', function () {
if (process.platform !== 'darwin') {
// FIXME(alexeykuzmin): Skip the test.
// this.skip()
return
}
crashReporter.start({
companyName: 'Umbrella Corporation',
submitURL: 'http://127.0.0.1/crashes',
uploadToServer: true
})
crashReporter.setUploadToServer(false)
assert.equal(crashReporter.getUploadToServer(), false)
})
it('sets uploadToServer true when called with true', () => {
if (process.platform === 'darwin') {
crashReporter.start({
companyName: 'Umbrella Corporation',
submitURL: 'http://127.0.0.1/crashes',
uploadToServer: false
})
crashReporter.setUploadToServer(true)
assert.equal(crashReporter.getUploadToServer(), true)
it('sets uploadToServer true when called with true', function () {
if (process.platform !== 'darwin') {
// FIXME(alexeykuzmin): Skip the test.
// this.skip()
return
}
crashReporter.start({
companyName: 'Umbrella Corporation',
submitURL: 'http://127.0.0.1/crashes',
uploadToServer: false
})
crashReporter.setUploadToServer(true)
assert.equal(crashReporter.getUploadToServer(), true)
})
})
@ -328,9 +347,12 @@ describe('crashReporter module', () => {
const parameters = crashReporter.getParameters()
assert(typeof parameters === 'object')
})
it('adds a parameter to current parameters', () => {
// only run on MacOS
if (process.platform !== 'darwin') return
it('adds a parameter to current parameters', function () {
if (process.platform !== 'darwin') {
// FIXME(alexeykuzmin): Skip the test.
// this.skip()
return
}
crashReporter.start({
companyName: 'Umbrella Corporation',
@ -340,9 +362,12 @@ describe('crashReporter module', () => {
crashReporter.addExtraParameter('hello', 'world')
assert('hello' in crashReporter.getParameters())
})
it('removes a parameter from current parameters', () => {
// only run on MacOS
if (process.platform !== 'darwin') return
it('removes a parameter from current parameters', function () {
if (process.platform !== 'darwin') {
// FIXME(alexeykuzmin): Skip the test.
// this.skip()
return
}
crashReporter.start({
companyName: 'Umbrella Corporation',