Skip to content

Commit

Permalink
debug build
Browse files Browse the repository at this point in the history
  • Loading branch information
diosmosis committed Oct 2, 2024
1 parent 99d4e48 commit ec1bb2b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"create": "mkdir -p dist && clasp create --rootDir dist --title='Matomo Looker Studio Connector' --type=standalone && mv ./dist/.clasp.json .",
"push": "tsx ./scripts/push.ts",
"test:appscript": "jest --config=./jest.config.appscript.ts",
"test": "npm run test:appscript",
"test": "npm run test:appscript -- ./tests/appscript/api.spec.ts",
"test:download-artifacts": "tsx ./scripts/download-expected.ts",
"update-secrets-in-ci": "tsx ./scripts/update_ci_secrets.ts"
},
Expand Down
9 changes: 9 additions & 0 deletions tests/appscript/api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ describe('api', () => {
}

async function waitForMockServer() {
const currentTest = expect.getState().currentTestName;

const testUrl = `${tunnel.url}/index.php`;
const body = {
method: 'SitesManager.getSitesIdWithAtLeastViewAccess',
Expand All @@ -57,8 +59,15 @@ describe('api', () => {
while (true) {
await new Promise((resolve) => setTimeout(resolve, 2000));

if (currentTest !== expect.getState().currentTestName) { // test timed out
return;
}

try {
console.log(`requesting ${testUrl} with ${body}`);
const response = await axios.post(testUrl, body);
console.log('response: ' + typeof(response.data));
console.log(JSON.stringify(response.data));
if (Array.isArray(response.data) && response.data[0] === 1) {
return;
}
Expand Down

0 comments on commit ec1bb2b

Please sign in to comment.