Skip to content

Commit

Permalink
Temp CI changes
Browse files Browse the repository at this point in the history
  • Loading branch information
owenpearson committed Jul 4, 2022
1 parent d0553cb commit 8845584
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
24 changes: 20 additions & 4 deletions src/platform/web/lib/transport/fetchrequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export default function fetchRequest(
rest ? rest.options.timeouts.httpRequestTimeout : Defaults.TIMEOUTS.httpRequestTimeout
);

console.log({ uri, _method, headers, body });

fetch(uri + '?' + new URLSearchParams(params || {}), {
method: _method,
headers: fetchHeaders,
Expand All @@ -47,6 +49,8 @@ export default function fetchRequest(
.then((res) => {
clearTimeout(timeout);
const contentType = res.headers.get('Content-Type');
console.log(`Request to ${uri + '?' + new URLSearchParams(params || {})}`);
console.log(`Response status: ${res.status} with Content-Type: ${contentType}`);
if (!res.ok) {
if (!contentType) {
// TODO
Expand All @@ -55,6 +59,8 @@ export default function fetchRequest(
}
if (contentType && contentType.indexOf('application/json') > -1) {
res.json().then((body) => {
console.log('here');
console.log(body);
const err =
getAblyError(body, res.headers) ||
new ErrorInfo(
Expand All @@ -75,10 +81,20 @@ export default function fetchRequest(
return;
}
if (contentType.indexOf('application/json') > -1) {
res.json().then((body) => {
callback(null, body, res.headers, true, res.status);
return;
});
res
.json()
.then((body) => {
console.log('here2');
console.log(body);
callback(null, body, res.headers, true, res.status);
return;
})
.catch((err) => {
console.log(err);
res.text().then((body) => {
console.log(body);
});
});
}
if (contentType.indexOf('application/x-msgpack') > -1) {
res.arrayBuffer().then((body) => {
Expand Down
4 changes: 2 additions & 2 deletions test/rest/push.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ define(['ably', 'shared_helper', 'async', 'chai'], function (Ably, helper, async
},
};

describe('rest/push', function () {
describe.only('rest/push', function () {
this.timeout(60 * 1000);

before(function (done) {
Expand All @@ -39,7 +39,7 @@ define(['ably', 'shared_helper', 'async', 'chai'], function (Ably, helper, async
});
});

it('Get subscriptions', function (done) {
it.only('Get subscriptions', function (done) {
var subscribes = [];
var deletes = [];
var subsByChannel = {};
Expand Down
4 changes: 4 additions & 0 deletions test/support/runPlaywrightTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ const runTests = async (browserType) => {
console.log(detail);
});

page.on('console', (msg) => {
console.log(msg.text());
});

// Expose a function inside the playwright browser to exit with the right status code when tests pass/fail
page.exposeFunction('onTestResult', ({ detail }) => {
console.log(`${browserType.name()} tests complete: ${detail.passes}/${detail.total} passed`);
Expand Down

0 comments on commit 8845584

Please sign in to comment.