Skip to content

Commit

Permalink
Try cache busting by always using latest runtime version
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy committed May 22, 2024
1 parent a1124f4 commit 86fc09a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/jest-amp/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import AmpOptimizer, {
TRANSFORMATIONS_AMP_FIRST,
} from '@ampproject/toolbox-optimizer';
import amphtmlValidator from 'amphtml-validator';
// eslint-disable-next-line import/no-extraneous-dependencies -- Required by @ampproject/toolbox-optimizer anyway.
import runtimeVersion from '@ampproject/toolbox-runtime-version';

const fallback = tmpdir() + '/validator_wasm.js';
const validatorJs =
Expand Down Expand Up @@ -123,6 +125,7 @@ async function getAMPValidationErrors(string, optimize = true) {
});
const params = {
canonical: 'https://example.com',
ampRuntimeVersion: await runtimeVersion.currentVersion(),
};
completeString = await ampOptimizer.transformHtml(completeString, params);
}
Expand Down

0 comments on commit 86fc09a

Please sign in to comment.