Skip to content

Commit

Permalink
debug test
Browse files Browse the repository at this point in the history
  • Loading branch information
diosmosis committed Oct 2, 2024
1 parent cca571f commit f282258
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
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
3 changes: 3 additions & 0 deletions src-test/callFunctionInTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ export function callFunctionInTestWithMockFixture(
...params: unknown[]
) {
const fixtureInstance = (ALL_FIXTURES[fixture.name])(...params);
console.log(fixture.name);
console.log(ALL_FIXTURES[fixture.name].toString());
console.log(UrlFetchApp.fetchAll.toString());
fixtureInstance.setUp();
try {
return callFunctionInTest(functionName, testName, ...params);
Expand Down
4 changes: 1 addition & 3 deletions tests/appscript/api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ describe('api', () => {
expect(requestCount).toEqual(1);
});

it('should abort when UrlFetchApp throws an unknown error', async () => {
it.only('should abort when UrlFetchApp throws an unknown error', async () => {
if (!process.env.USE_LOCALTUNNEL) {
console.log('*** SKIPPING TEST ***');
return;
Expand All @@ -299,7 +299,6 @@ describe('api', () => {
const errorMessage = 'unknown error';

await expect(async () => {
// check it does not throw when an Error is used
await Clasp.runWithFixture(
{ name: 'urlfetchapp', params: [ errorMessage ] },
'fetchAll',
Expand All @@ -314,7 +313,6 @@ describe('api', () => {
);
}).rejects.toHaveProperty('message', errorMessage);

// check it does not throw when a string is used
await expect(async () => {
await Clasp.runWithFixture(
{ name: 'urlfetchapp', params: [ errorMessage, true ] },
Expand Down

0 comments on commit f282258

Please sign in to comment.