Skip to content

Commit

Permalink
test: relative paths in snapshots (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
apaleslimghost committed Dec 16, 2024
1 parent 4c8beb4 commit 5963b5f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ exports[`LoadWorkspaceConfigs should load multiple tool kit configs from workspa
},
"version": 2,
},
"root": "/Users/kara.brightwell/Code/financial-times/dotcom-tool-kit/plugins/webpack",
"root": "plugins/webpack",
},
"tasks": [
{
Expand Down Expand Up @@ -160,7 +160,7 @@ exports[`LoadWorkspaceConfigs should load multiple tool kit configs from workspa
},
"version": 2,
},
"root": "/Users/kara.brightwell/Code/financial-times/dotcom-tool-kit/plugins/webpack",
"root": "plugins/webpack",
},
"task": "Webpack",
},
Expand Down Expand Up @@ -212,7 +212,7 @@ exports[`LoadWorkspaceConfigs should load multiple tool kit configs from workspa
},
"version": 2,
},
"root": "/Users/kara.brightwell/Code/financial-times/dotcom-tool-kit/plugins/webpack",
"root": "plugins/webpack",
},
],
"id": "app root",
Expand Down Expand Up @@ -292,7 +292,7 @@ exports[`LoadWorkspaceConfigs should load multiple tool kit configs from workspa
},
"version": 2,
},
"root": "/Users/kara.brightwell/Code/financial-times/dotcom-tool-kit/plugins/webpack",
"root": "plugins/webpack",
},
],
"id": "app root",
Expand Down Expand Up @@ -402,7 +402,7 @@ exports[`LoadWorkspaceConfigs should load multiple tool kit configs from workspa
},
"version": 2,
},
"root": "/Users/kara.brightwell/Code/financial-times/dotcom-tool-kit/plugins/webpack",
"root": "plugins/webpack",
},
"tasks": [
{
Expand Down Expand Up @@ -482,7 +482,7 @@ exports[`LoadWorkspaceConfigs should load multiple tool kit configs from workspa
},
"version": 2,
},
"root": "/Users/kara.brightwell/Code/financial-times/dotcom-tool-kit/plugins/webpack",
"root": "plugins/webpack",
},
"task": "Webpack",
},
Expand Down Expand Up @@ -563,7 +563,7 @@ exports[`LoadWorkspaceConfigs should load multiple tool kit configs from workspa
},
"version": 2,
},
"root": "/Users/kara.brightwell/Code/financial-times/dotcom-tool-kit/plugins/webpack",
"root": "plugins/webpack",
},
"tasks": [
{
Expand Down Expand Up @@ -644,7 +644,7 @@ exports[`LoadWorkspaceConfigs should load multiple tool kit configs from workspa
},
"version": 2,
},
"root": "/Users/kara.brightwell/Code/financial-times/dotcom-tool-kit/plugins/webpack",
"root": "plugins/webpack",
},
"task": "Webpack",
},
Expand Down Expand Up @@ -700,7 +700,7 @@ exports[`LoadWorkspaceConfigs should load multiple tool kit configs from workspa
},
"version": 2,
},
"root": "/Users/kara.brightwell/Code/financial-times/dotcom-tool-kit/plugins/webpack",
"root": "plugins/webpack",
},
],
"id": "app root",
Expand Down Expand Up @@ -778,7 +778,7 @@ exports[`LoadWorkspaceConfigs should load multiple tool kit configs from workspa
},
"version": 2,
},
"root": "/Users/kara.brightwell/Code/financial-times/dotcom-tool-kit/plugins/webpack",
"root": "plugins/webpack",
},
],
"id": "app root",
Expand Down Expand Up @@ -885,7 +885,7 @@ exports[`LoadWorkspaceConfigs should load multiple tool kit configs from workspa
},
"version": 2,
},
"root": "/Users/kara.brightwell/Code/financial-times/dotcom-tool-kit/plugins/webpack",
"root": "plugins/webpack",
},
"app root": {
"children": [
Expand Down Expand Up @@ -931,7 +931,7 @@ exports[`LoadWorkspaceConfigs should load multiple tool kit configs from workspa
},
"version": 2,
},
"root": "/Users/kara.brightwell/Code/financial-times/dotcom-tool-kit/plugins/webpack",
"root": "plugins/webpack",
},
],
"id": "app root",
Expand Down Expand Up @@ -1056,7 +1056,7 @@ exports[`LoadWorkspaceConfigs should load multiple tool kit configs from workspa
},
"version": 2,
},
"root": "/Users/kara.brightwell/Code/financial-times/dotcom-tool-kit/plugins/webpack",
"root": "plugins/webpack",
},
},
},
Expand Down Expand Up @@ -1124,7 +1124,7 @@ exports[`LoadWorkspaceConfigs should load multiple tool kit configs from workspa
},
"version": 2,
},
"root": "/Users/kara.brightwell/Code/financial-times/dotcom-tool-kit/plugins/babel",
"root": "plugins/babel",
},
"tasks": [
{
Expand Down Expand Up @@ -1184,7 +1184,7 @@ exports[`LoadWorkspaceConfigs should load multiple tool kit configs from workspa
},
"version": 2,
},
"root": "/Users/kara.brightwell/Code/financial-times/dotcom-tool-kit/plugins/babel",
"root": "plugins/babel",
},
"task": "Babel",
},
Expand Down Expand Up @@ -1218,7 +1218,7 @@ exports[`LoadWorkspaceConfigs should load multiple tool kit configs from workspa
},
"version": 2,
},
"root": "/Users/kara.brightwell/Code/financial-times/dotcom-tool-kit/plugins/babel",
"root": "plugins/babel",
},
],
"id": "app root",
Expand Down Expand Up @@ -1280,7 +1280,7 @@ exports[`LoadWorkspaceConfigs should load multiple tool kit configs from workspa
},
"version": 2,
},
"root": "/Users/kara.brightwell/Code/financial-times/dotcom-tool-kit/plugins/babel",
"root": "plugins/babel",
},
],
"id": "app root",
Expand Down Expand Up @@ -1372,7 +1372,7 @@ exports[`LoadWorkspaceConfigs should load multiple tool kit configs from workspa
},
"version": 2,
},
"root": "/Users/kara.brightwell/Code/financial-times/dotcom-tool-kit/plugins/babel",
"root": "plugins/babel",
},
"tasks": [
{
Expand Down Expand Up @@ -1432,7 +1432,7 @@ exports[`LoadWorkspaceConfigs should load multiple tool kit configs from workspa
},
"version": 2,
},
"root": "/Users/kara.brightwell/Code/financial-times/dotcom-tool-kit/plugins/babel",
"root": "plugins/babel",
},
"task": "Babel",
},
Expand Down Expand Up @@ -1470,7 +1470,7 @@ exports[`LoadWorkspaceConfigs should load multiple tool kit configs from workspa
},
"version": 2,
},
"root": "/Users/kara.brightwell/Code/financial-times/dotcom-tool-kit/plugins/babel",
"root": "plugins/babel",
},
],
"id": "app root",
Expand Down Expand Up @@ -1530,7 +1530,7 @@ exports[`LoadWorkspaceConfigs should load multiple tool kit configs from workspa
},
"version": 2,
},
"root": "/Users/kara.brightwell/Code/financial-times/dotcom-tool-kit/plugins/babel",
"root": "plugins/babel",
},
],
"id": "app root",
Expand Down Expand Up @@ -1619,7 +1619,7 @@ exports[`LoadWorkspaceConfigs should load multiple tool kit configs from workspa
},
"version": 2,
},
"root": "/Users/kara.brightwell/Code/financial-times/dotcom-tool-kit/plugins/babel",
"root": "plugins/babel",
},
"app root": {
"children": [
Expand Down Expand Up @@ -1647,7 +1647,7 @@ exports[`LoadWorkspaceConfigs should load multiple tool kit configs from workspa
},
"version": 2,
},
"root": "/Users/kara.brightwell/Code/financial-times/dotcom-tool-kit/plugins/babel",
"root": "plugins/babel",
},
],
"id": "app root",
Expand Down Expand Up @@ -1754,7 +1754,7 @@ exports[`LoadWorkspaceConfigs should load multiple tool kit configs from workspa
},
"version": 2,
},
"root": "/Users/kara.brightwell/Code/financial-times/dotcom-tool-kit/plugins/babel",
"root": "plugins/babel",
},
},
},
Expand Down
10 changes: 10 additions & 0 deletions plugins/monorepo/test/load-workspace-configs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ import { stripAnsi } from '@relmify/jest-serializer-strip-ansi'

const logger = winston as unknown as Logger

// force resolveRoot to return relative paths for machine-agnostic snapshots
jest.mock('../../../core/cli/lib/plugin/resolve-root', () => {
const { resolveRoot } = jest.requireActual('../../../core/cli/lib/plugin/resolve-root')
return {
resolveRoot(id: string, root: string) {
return path.relative(process.cwd(), resolveRoot(id, root))
}
}
})

expect.addSnapshotSerializer(stripAnsi)

expect.addSnapshotSerializer({
Expand Down

0 comments on commit 5963b5f

Please sign in to comment.