Skip to content

Commit

Permalink
Fix makeTestPending to run in beforeEach
Browse files Browse the repository at this point in the history
Calling pending only works for beforeEach jasmine/jasmine#1579

And the stopSpecOnExpectationFailure setting only works for node cli. Have to use oneFailurePerSpec for karma-jasmine:
karma-runner/karma-jasmine#218
  • Loading branch information
rajsite committed Jun 3, 2019
1 parent 9ee22ad commit 43e338d
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 13 deletions.
5 changes: 4 additions & 1 deletion test-it/karma/http/HttpDelete.Test.js
Expand Up @@ -35,14 +35,17 @@ describe('Performing a DELETE request', function () {
});

beforeAll(async function () {
httpBinHelpers.makeTestPendingIfHttpBinOffline();
vireo = await vireoHelpers.createInstance();
});

afterAll(function () {
vireo = undefined;
});

beforeEach(function () {
httpBinHelpers.makeTestPendingIfHttpBinOffline();
});

it('with a simple 200 response', function (done) {
var runSlicesAsync = vireoRunner.rebootAndLoadVia(vireo, httpDeleteMethodViaUrl);
var viPathParser = vireoRunner.createVIPathParser(vireo, 'MyVI');
Expand Down
5 changes: 4 additions & 1 deletion test-it/karma/http/HttpGet.Test.js
Expand Up @@ -41,14 +41,17 @@ describe('Performing a GET request', function () {
});

beforeAll(async function () {
httpBinHelpers.makeTestPendingIfHttpBinOffline();
vireo = await vireoHelpers.createInstance();
});

afterAll(function () {
vireo = undefined;
});

beforeEach(function () {
httpBinHelpers.makeTestPendingIfHttpBinOffline();
});

it('with a simple 200 response', function (done) {
var runSlicesAsync = vireoRunner.rebootAndLoadVia(vireo, httpGetMethodViaUrl);
var viPathParser = vireoRunner.createVIPathParser(vireo, 'MyVI');
Expand Down
5 changes: 4 additions & 1 deletion test-it/karma/http/HttpHead.Test.js
Expand Up @@ -34,14 +34,17 @@ describe('Performing a HEAD request', function () {
});

beforeAll(async function () {
httpBinHelpers.makeTestPendingIfHttpBinOffline();
vireo = await vireoHelpers.createInstance();
});

afterAll(function () {
vireo = undefined;
});

beforeEach(function () {
httpBinHelpers.makeTestPendingIfHttpBinOffline();
});

it('with a simple 200 response', function (done) {
var runSlicesAsync = vireoRunner.rebootAndLoadVia(vireo, httpHeadMethodViaUrl);
var viPathParser = vireoRunner.createVIPathParser(vireo, 'MyVI');
Expand Down
5 changes: 4 additions & 1 deletion test-it/karma/http/HttpPost.Test.js
Expand Up @@ -35,14 +35,17 @@ describe('Performing a POST request', function () {
});

beforeAll(async function () {
httpBinHelpers.makeTestPendingIfHttpBinOffline();
vireo = await vireoHelpers.createInstance();
});

afterAll(function () {
vireo = undefined;
});

beforeEach(function () {
httpBinHelpers.makeTestPendingIfHttpBinOffline();
});

it('with a simple 200 response', function (done) {
var runSlicesAsync = vireoRunner.rebootAndLoadVia(vireo, httpPostMethodViaUrl);
var viPathParser = vireoRunner.createVIPathParser(vireo, 'MyVI');
Expand Down
5 changes: 4 additions & 1 deletion test-it/karma/http/HttpPut.Test.js
Expand Up @@ -35,14 +35,17 @@ describe('Performing a PUT request', function () {
});

beforeAll(async function () {
httpBinHelpers.makeTestPendingIfHttpBinOffline();
vireo = await vireoHelpers.createInstance();
});

afterAll(function () {
vireo = undefined;
});

beforeEach(function () {
httpBinHelpers.makeTestPendingIfHttpBinOffline();
});

it('with a simple 200 response', function (done) {
var runSlicesAsync = vireoRunner.rebootAndLoadVia(vireo, httpPutMethodViaUrl);
var viPathParser = vireoRunner.createVIPathParser(vireo, 'MyVI');
Expand Down
15 changes: 9 additions & 6 deletions test-it/karma/http/Timeout.Test.js
Expand Up @@ -23,20 +23,23 @@ describe('Timeout test suite #Slow', function () {
httpBinHelpers.queryHttpBinStatus(done);
});

beforeEach(function (done) {
// The timeout tests sometimes need a recovery period so perform a full get request and wait for it before continuing
httpBinHelpers.forceHttpBinQuery('get?show_env=1', done);
});

beforeAll(async function () {
httpBinHelpers.makeTestPendingIfHttpBinOffline();
vireo = await vireoHelpers.createInstance();
});

afterAll(function () {
vireo = undefined;
});

beforeEach(function () {
httpBinHelpers.makeTestPendingIfHttpBinOffline();
});

beforeEach(function (done) {
// The timeout tests sometimes need a recovery period so perform a full get request and wait for it before continuing
httpBinHelpers.forceHttpBinQuery('get?show_env=1', done);
});

it('GET method with timeout 0s times out with httpbin delay of 10s', function (done) {
var timeout = 0;
var timeoutEpsilon = 1000;
Expand Down
11 changes: 9 additions & 2 deletions test-it/karma/http/httpCORS.Test.js
Expand Up @@ -20,11 +20,18 @@ describe('Performing a CORS request', function () {
httpBinHelpers.queryHttpBinStatus(done);
});

beforeEach(async function () {
httpBinHelpers.makeTestPendingIfHttpBinOffline();
beforeAll(async function () {
vireo = await vireoHelpers.createInstance();
});

afterAll(function () {
vireo = undefined;
});

beforeEach(function () {
httpBinHelpers.makeTestPendingIfHttpBinOffline();
});

beforeEach(function (done) {
httpBinHelpers.forceHttpBinQuery('cookies/set?FastestLandAnimal=cheetah', done);
});
Expand Down

0 comments on commit 43e338d

Please sign in to comment.