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 b546512
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
- name: Prepare
run: |
mkdir -p ./tests/utilities/mwp-localtunnel-client
curl "https://gist.githubusercontent.com/$MWP_LOCALTUNNEL_CLIENT_URL_PATH" > ./tests/utilities/mwp-localtunnel-client/index.js
curl "https://gist.githubusercontent.com/$MWP_LOCALTUNNEL_CLIENT_URL_PATH" > ./tests/utilities/mwp-localtunnel-client/index.ts
env:
MWP_LOCALTUNNEL_CLIENT_URL_PATH: ${{ secrets.MWP_LOCALTUNNEL_CLIENT_URL_PATH }}

Expand Down
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 b546512

Please sign in to comment.