diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f68e3c30..56cd2e5a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,8 @@ name: Test -on: push +on: + push: + pull_request: jobs: run-tests: diff --git a/packages/auth0/test/fixtures/rules-async-only/async-rule.js b/packages/auth0/test/fixtures/rules-async-only/async-rule.js index b8c7476e..e983185f 100644 --- a/packages/auth0/test/fixtures/rules-async-only/async-rule.js +++ b/packages/auth0/test/fixtures/rules-async-only/async-rule.js @@ -17,7 +17,7 @@ async function asyncRule(user, context, callback) { // these is a contrived rule, but entirely possible // that someone would run a fetch and attach output // to the user as part of the token - let checkURLOne = "https://frontside.com"; + let checkURLOne = `${__simulator.context.idToken.iss}frontside`; user.checkURLOne = checkURLOne; let checkOne = await fetcher(checkURLOne); user.checkURLOneStatus = checkOne.checkURLStatus; @@ -25,7 +25,7 @@ async function asyncRule(user, context, callback) { // this is a sub-site with various redirects to it should // take some time to revolve - let checkURLTwo = "https://frontside.com/effection"; + let checkURLTwo = `${__simulator.context.idToken.iss}effection`; user.checkURLTwo = checkURLTwo; let checkTwo = await fetcher(checkURLTwo); user.checkURLTwoStatus = checkTwo.checkURLStatus; diff --git a/packages/auth0/test/fixtures/rules-sync-wrapper-with-async/async-rule.js b/packages/auth0/test/fixtures/rules-sync-wrapper-with-async/async-rule.js index 9d858be9..f6cb0382 100644 --- a/packages/auth0/test/fixtures/rules-sync-wrapper-with-async/async-rule.js +++ b/packages/auth0/test/fixtures/rules-sync-wrapper-with-async/async-rule.js @@ -7,12 +7,12 @@ function syncWrapper(user, context, callback) { // these is a contrived rule, but entirely possible // that someone would run a fetch and attach output // to the user as part of the token - let checkURLOne = "https://frontside.com"; + let checkURLOne = `${__simulator.context.idToken.iss}frontside`; user.checkURLOne = checkURLOne; // this is a sub-site with various redirects to it should // take some time to revolve - let checkURLTwo = "https://frontside.com/effection"; + let checkURLTwo = `${__simulator.context.idToken.iss}effection`; user.checkURLTwo = checkURLTwo; let fetcher = async (url) => { diff --git a/packages/auth0/test/rules.test.ts b/packages/auth0/test/rules.test.ts index 6d91a8f0..ce625f58 100644 --- a/packages/auth0/test/rules.test.ts +++ b/packages/auth0/test/rules.test.ts @@ -43,6 +43,20 @@ async function createSimulation(rulesDirectory: Fixtures, initialPerson?: Partia users: [simulationPerson], }, options: { rulesDirectory }, + extend: { + extendRouter(router) { + router.get("/frontside", (_req, res) => { + res.send( + "