Skip to content

Commit

Permalink
[HttpClient] fix(tests): restore execution of http-client tests in gh…
Browse files Browse the repository at this point in the history
…a windows
  • Loading branch information
alekitto committed Nov 5, 2023
1 parent 83ee1d4 commit de4c1d2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/NativeHttpClientTest.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const HttpClientTestCase = Jymfony.Contracts.HttpClient.Test.HttpClientTestCase;
const NativeHttpClient = Jymfony.Component.HttpClient.NativeHttpClient;
const TestHttpServer = Jymfony.Contracts.HttpClient.Test.TestHttpServer;

export default class NativeHttpClientTest extends HttpClientTestCase {
beforeEach() {
Expand All @@ -8,6 +9,22 @@ export default class NativeHttpClientTest extends HttpClientTestCase {
}
}

async before() {
if (!!process.env.GITHUB_WORKFLOW && __jymfony.Platform.isWindows()) { // Tests on windows are too unstable on GHA
return;
}

__self.server = await TestHttpServer.start();
}

async after() {
if (!!process.env.GITHUB_WORKFLOW && __jymfony.Platform.isWindows()) { // Tests on windows are too unstable on GHA
return;
}

await __self.server.stop();
}

getHttpClient() {
return new NativeHttpClient();
}
Expand Down

0 comments on commit de4c1d2

Please sign in to comment.