Skip to content

Commit

Permalink
test(Proxy): skip Proxy.test.js (#1667)
Browse files Browse the repository at this point in the history
This test is unstable when running on Node v11 on MacOS.
  • Loading branch information
hiroppy authored and evilebottnawi committed Feb 18, 2019
1 parent b92e5fd commit b2bcdb0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/Proxy.test.js
Expand Up @@ -6,6 +6,7 @@ const express = require('express');
const WebSocket = require('ws');
const helper = require('./helper');
const config = require('./fixtures/proxy-config/webpack.config');
const shouldSkipTestSuite = require('./shouldSkipTestSuite');

const WebSocketServer = WebSocket.Server;
const contentBase = path.join(__dirname, 'fixtures/proxy-config');
Expand Down Expand Up @@ -62,6 +63,11 @@ function startProxyServers() {
}

describe('Proxy', () => {
// issue: https://github.com/webpack/webpack-dev-server/pull/1633#issuecomment-463938675
if (shouldSkipTestSuite()) {
return;
}

describe('proxy options is a object', () => {
let server;
let req;
Expand Down
20 changes: 20 additions & 0 deletions test/shouldSkipTestSuite.js
@@ -0,0 +1,20 @@
'use strict';

const semver = require('semver');

// issue: https://github.com/nodejs/node/issues/24835
function shouldSkipTestSuite() {
if (
semver.satisfies(process.version, '11') &&
process.platform === 'darwin'
) {
it('skip', () => {
expect(true).toBeTruthy();
});

return true;
}
return false;
}

module.exports = shouldSkipTestSuite;

0 comments on commit b2bcdb0

Please sign in to comment.