Skip to content

Commit

Permalink
try to fix the test failure with a timeout?
Browse files Browse the repository at this point in the history
  • Loading branch information
diosmosis committed Sep 11, 2024
1 parent dcb4a5e commit 0d5a84f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"clasp": "clasp",
"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 tests/appscript/api.spec.ts",
"test:appscript": "jest --config=./jest.config.appscript.ts",
"test": "npm run test:appscript",
"test:download-artifacts": "tsx ./scripts/download-expected.ts",
"update-secrets-in-ci": "tsx ./scripts/update_ci_secrets.ts"
Expand Down
2 changes: 0 additions & 2 deletions src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ export function getAuthType() {

export function checkForValidCreds(instanceUrl?: string, token?: string) {
try {
console.log(instanceUrl, token);
const responseContent = Api.fetch('SitesManager.getSitesIdWithAtLeastViewAccess', {}, {
instanceUrl,
token,
});
console.log(responseContent);
return Array.isArray(responseContent) && !!responseContent.length;
} catch (error) {
debugLog('checkForValidCreds:', 'failed to get sites ID with parameters', error.stack || error.message);
Expand Down
4 changes: 3 additions & 1 deletion tests/appscript/api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ describe('api', () => {
await Clasp.setScriptProperties({}, true);
});

it.only('should retry if a probably random error is returned', async () => {
it('should retry if a probably random error is returned', async () => {
if (!process.env.USE_LOCALTUNNEL) {
console.log('*** SKIPPING TEST ***');
return;
Expand All @@ -128,6 +128,8 @@ describe('api', () => {
},
});

await new Promise((resolve) => setTimeout(resolve, 3000));

// use the mock server's path that forces a random error
const result = await Clasp.run('setCredentials', {
userToken: {
Expand Down

0 comments on commit 0d5a84f

Please sign in to comment.