diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7021d76a79..190a17055f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,25 +38,23 @@ jobs: # Note that *if you add* to this, remember to also add that # to the **required checks** in the branch protection rules. name: - # tests/ directory - - content - - rendering - - rendering-fixtures - - routing - - unit - # src/ directory - archives - assets - audit-logs - automated-pipelines + # - bookmarklets + - changelogs # - codeql-cli - color-schemes - content-linter - content-render + - data-directory + # - dev-toc - early-access - events - # - frame + - fixtures + - frame - ghes-releases - github-apps - graphql @@ -68,12 +66,14 @@ jobs: # - open-source - pageinfo # - pages + - products - redirects - release-notes - rest - search - secret-scanning - shielding + # - tests # - tools - versions - webhooks @@ -103,23 +103,23 @@ jobs: token: ${{ secrets.DOCS_BOT_PAT_READPUBLICKEY }} - name: Check the test fixture data (if applicable) - if: ${{ matrix.name == 'rendering-fixtures' }} + if: ${{ matrix.name == 'fixtures' }} run: ./src/tests/scripts/copy-fixture-data.js --check # This keeps our fixture content/data in check - name: Check the test fixture content (if applicable) - if: ${{ matrix.name == 'rendering-fixtures' }} + if: ${{ matrix.name == 'fixtures' }} env: - ROOT: tests/fixtures + ROOT: src/fixtures/fixtures run: | # If either of these fail, it means our fixture content's internal # links can and should be updated. ./src/links/scripts/update-internal-links.js --dry-run --check --strict \ - tests/fixtures/content \ - --exclude tests/fixtures/content/get-started/foo/typo-autotitling.md \ - --exclude tests/fixtures/content/get-started/foo/anchor-autotitling.md + src/fixtures/fixtures/content \ + --exclude src/fixtures/fixtures/content/get-started/foo/typo-autotitling.md \ + --exclude src/fixtures/fixtures/content/get-started/foo/anchor-autotitling.md ./src/links/scripts/update-internal-links.js --dry-run --check --strict \ - tests/fixtures/data + src/fixtures/fixtures/data - name: Clone all translations if: ${{ matrix.name == 'languages' }} @@ -169,7 +169,7 @@ jobs: - uses: ./.github/actions/warmup-remotejson-cache # Only the 'routing' tests include end-to-end tests about # archived enterprise server URLs. - if: ${{ matrix.name == 'routing' }} + if: ${{ matrix.name == 'redirects' }} - name: Index fixtures into the local Elasticsearch # For the sake of saving time, only run this step if the group @@ -180,17 +180,11 @@ jobs: - name: Run tests env: DIFF_FILE: get_diff_files.txt - CHANGELOG_CACHE_FILE_PATH: tests/fixtures/changelog-feed.json + CHANGELOG_CACHE_FILE_PATH: src/fixtures/fixtures/changelog-feed.json # By default, when `process.env.NODE_ENV === 'test'` it forces the # tests run only in English. The exception is the # `languages` suite which needs all languages to be set up. ENABLED_LANGUAGES: ${{ matrix.name == 'languages' && 'all' || '' }} - ROOT: ${{ (matrix.name == 'rendering-fixtures' || matrix.name == 'pageinfo' || matrix.name == 'landings' ) && 'tests/fixtures' || '' }} - TRANSLATIONS_FIXTURE_ROOT: ${{ (matrix.name == 'rendering-fixtures' || matrix.name == 'pageinfo') && 'tests/fixtures/translations' || '' }} - run: | - if [ -d "tests/${{ matrix.name }}/" ] - then - npm test -- tests/${{ matrix.name }}/ - else - npm test -- src/${{ matrix.name }}/tests/ - fi + ROOT: ${{ (matrix.name == 'fixtures' || matrix.name == 'pageinfo' || matrix.name == 'landings' ) && 'src/fixtures/fixtures' || '' }} + TRANSLATIONS_FIXTURE_ROOT: ${{ (matrix.name == 'fixtures' || matrix.name == 'pageinfo') && 'src/fixtures/fixtures/translations' || '' }} + run: npm test -- src/${{ matrix.name }}/tests/ diff --git a/content/actions/examples/using-concurrency-expressions-and-a-test-matrix.md b/content/actions/examples/using-concurrency-expressions-and-a-test-matrix.md index cd3c69740c..cd3f3b7ad2 100644 --- a/content/actions/examples/using-concurrency-expressions-and-a-test-matrix.md +++ b/content/actions/examples/using-concurrency-expressions-and-a-test-matrix.md @@ -212,7 +212,7 @@ jobs: - name: Run tests env: DIFF_FILE: get_diff_files.txt - CHANGELOG_CACHE_FILE_PATH: tests/fixtures/changelog-feed.json + CHANGELOG_CACHE_FILE_PATH: src/fixtures/fixtures/changelog-feed.json run: npm test -- {% raw %}tests/${{ matrix.test-group }}/{% endraw %} ``` diff --git a/package.json b/package.json index e912ed2f3d..67ef8838a3 100644 --- a/package.json +++ b/package.json @@ -19,8 +19,8 @@ "build": "next build", "debug": "cross-env NODE_ENV=development ENABLED_LANGUAGES=en nodemon --inspect src/frame/server.js", "dev": "cross-env npm start", - "fixture-dev": "cross-env ROOT=tests/fixtures npm start", - "fixture-test": "cross-env ROOT=tests/fixtures npm test -- tests/rendering-fixtures", + "fixture-dev": "cross-env ROOT=src/fixtures/fixtures npm start", + "fixture-test": "cross-env ROOT=src/fixtures/fixtures npm test -- src/fixtures/tests", "index-test-fixtures": "node src/search/scripts/index-elasticsearch.js -l en -l ja -V ghae -V dotcom --index-prefix tests -- src/search/tests/fixtures/search-indexes", "lint": "eslint '**/*.{js,mjs,ts,tsx}'", "lint-content": "node src/content-linter/scripts/lint-content.js", @@ -37,7 +37,7 @@ "prestart": "node src/workflows/cmp-files.js package-lock.json .installed.package-lock.json || npm install && cp package-lock.json .installed.package-lock.json", "start": "cross-env NODE_ENV=development ENABLED_LANGUAGES=en nodemon src/frame/server.js", "start-all-languages": "cross-env NODE_ENV=development nodemon src/frame/server.js", - "start-for-playwright": "cross-env ROOT=tests/fixtures TRANSLATIONS_FIXTURE_ROOT=tests/fixtures/translations ENABLED_LANGUAGES=en,ja NODE_ENV=test node src/frame/server.js", + "start-for-playwright": "cross-env ROOT=src/fixtures/fixtures TRANSLATIONS_FIXTURE_ROOT=src/fixtures/fixtures/translations ENABLED_LANGUAGES=en,ja NODE_ENV=test node src/frame/server.js", "sync-rest": "node src/rest/scripts/update-files.js", "sync-search": "cross-env NODE_OPTIONS='--max_old_space_size=8192' start-server-and-test sync-search-server 4002 sync-search-indices", "sync-search-ghes-release": "cross-env GHES_RELEASE=1 start-server-and-test sync-search-server 4002 sync-search-indices", @@ -200,8 +200,8 @@ "testPathIgnorePatterns": [ "node_modules/", "vendor/", - "tests/fixtures/", - "tests/helpers/" + "src/fixtures/fixtures/", + "src/tests/helpers/" ] }, "dependencies": { diff --git a/playwright.config.ts b/playwright.config.ts index 07a26e04ba..c28768eda5 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -10,7 +10,7 @@ import { defineConfig, devices } from '@playwright/test' * See https://playwright.dev/docs/test-configuration. */ export default defineConfig({ - testDir: './tests', + testDir: './src/fixtures/tests', /* Maximum time one test can run for. */ timeout: 30 * 1000, expect: { diff --git a/src/archives/tests/deprecated-enterprise-versions.js b/src/archives/tests/deprecated-enterprise-versions.js index e5c2d6ecb4..5291fcd51c 100644 --- a/src/archives/tests/deprecated-enterprise-versions.js +++ b/src/archives/tests/deprecated-enterprise-versions.js @@ -1,7 +1,7 @@ import { describe, jest, test } from '@jest/globals' import enterpriseServerReleases from '#src/versions/lib/enterprise-server-releases.js' -import { get, getDOM } from '../../../tests/helpers/e2etest.js' +import { get, getDOM } from '#src/tests/helpers/e2etest.js' import { SURROGATE_ENUMS } from '#src/frame/middleware/set-fastly-surrogate-key.js' jest.useFakeTimers({ legacyFakeTimers: true }) diff --git a/src/assets/scripts/find-orphaned-assets.js b/src/assets/scripts/find-orphaned-assets.js index 25f798a270..57b0788564 100755 --- a/src/assets/scripts/find-orphaned-assets.js +++ b/src/assets/scripts/find-orphaned-assets.js @@ -95,7 +95,7 @@ async function main(opts) { } } - const roots = ['tests', 'contributing', 'src', 'assets'] + const roots = ['contributing', 'src', 'assets'] for (const root of roots) { sourceFiles.push( diff --git a/src/assets/tests/dynamic-assets.js b/src/assets/tests/dynamic-assets.js index c1a1c2717a..826e211925 100644 --- a/src/assets/tests/dynamic-assets.js +++ b/src/assets/tests/dynamic-assets.js @@ -3,7 +3,7 @@ import sharp from 'sharp' import { fileTypeFromBuffer } from 'file-type' import { SURROGATE_ENUMS } from '#src/frame/middleware/set-fastly-surrogate-key.js' -import { get, head } from '../../../tests/helpers/e2etest.js' +import { get, head } from '#src/tests/helpers/e2etest.js' describe('dynamic assets', () => { jest.setTimeout(3 * 60 * 1000) diff --git a/src/assets/tests/static-assets-1.js b/src/assets/tests/static-assets-1.js index 5742774b49..7c61de27b7 100644 --- a/src/assets/tests/static-assets-1.js +++ b/src/assets/tests/static-assets-1.js @@ -1,7 +1,7 @@ import nock from 'nock' import { expect, jest } from '@jest/globals' -import { checkCachingHeaders } from '../../../tests/helpers/caching-headers.js' +import { checkCachingHeaders } from '#src/tests/helpers/caching-headers.js' import { setDefaultFastlySurrogateKey } from '#src/frame/middleware/set-fastly-surrogate-key.js' import archivedEnterpriseVersionsAssets from '#src/archives/middleware/archived-enterprise-versions-assets.js' diff --git a/src/assets/tests/static-assets.js b/src/assets/tests/static-assets.js index 1708322b04..c1d60b8073 100644 --- a/src/assets/tests/static-assets.js +++ b/src/assets/tests/static-assets.js @@ -3,8 +3,8 @@ import path from 'path' import { jest, expect } from '@jest/globals' -import { get } from '../../../tests/helpers/e2etest.js' -import { checkCachingHeaders } from '../../../tests/helpers/caching-headers.js' +import { get } from '#src/tests/helpers/e2etest.js' +import { checkCachingHeaders } from '#src/tests/helpers/caching-headers.js' function getNextStaticAsset(directory) { const root = path.join('.next', 'static', directory) diff --git a/src/audit-logs/tests/rendering.js b/src/audit-logs/tests/rendering.js index e7b1684ceb..4450afbf50 100644 --- a/src/audit-logs/tests/rendering.js +++ b/src/audit-logs/tests/rendering.js @@ -1,6 +1,6 @@ import { expect } from '@jest/globals' -import { getDOM } from '../../../tests/helpers/e2etest.js' +import { getDOM } from '#src/tests/helpers/e2etest.js' import { allVersions } from '#src/versions/lib/all-versions.js' import { getAuditLogEvents } from '../lib/index.js' diff --git a/src/automated-pipelines/tests/rendering.js b/src/automated-pipelines/tests/rendering.js index 2e4858f4e8..89f5ffbd02 100644 --- a/src/automated-pipelines/tests/rendering.js +++ b/src/automated-pipelines/tests/rendering.js @@ -4,7 +4,7 @@ import cheerio from 'cheerio' import { jest, test } from '@jest/globals' import { loadPages } from '#src/frame/lib/page-data.js' -import { get } from '../../../tests/helpers/e2etest.js' +import { get } from '#src/tests/helpers/e2etest.js' // Get a list of the autogenerated pages const pageList = await loadPages(undefined, ['en']) diff --git a/tests/fixtures/data/reusables/gated-features/empty.md b/src/changelogs/README.md similarity index 100% rename from tests/fixtures/data/reusables/gated-features/empty.md rename to src/changelogs/README.md diff --git a/tests/unit/get-rss-feeds.js b/src/changelogs/tests/get-rss-feeds.js similarity index 97% rename from tests/unit/get-rss-feeds.js rename to src/changelogs/tests/get-rss-feeds.js index 6c38aaff62..1a28787976 100644 --- a/tests/unit/get-rss-feeds.js +++ b/src/changelogs/tests/get-rss-feeds.js @@ -10,7 +10,7 @@ describe('getChangelogItems module', () => { beforeAll(async () => { const rssFeedContent = await fs.readFile( - path.join(process.cwd(), 'tests/fixtures/rss-feed.xml'), + path.join(process.cwd(), 'src/fixtures/fixtures/rss-feed.xml'), 'utf8', ) diff --git a/src/content-linter/tests/lint-frontmatter.js b/src/content-linter/tests/lint-frontmatter.js index 8d2173d71d..1108ee22fb 100644 --- a/src/content-linter/tests/lint-frontmatter.js +++ b/src/content-linter/tests/lint-frontmatter.js @@ -1,6 +1,6 @@ import { loadPages, loadPageMap } from '#src/frame/lib/page-data.js' import loadRedirects from '#src/redirects/lib/precompile.js' -import { checkURL } from '../../../tests/helpers/check-url.js' +import { checkURL } from '#src/tests/helpers/check-url.js' const pageList = await loadPages(undefined, ['en']) const pages = await loadPageMap(pageList) diff --git a/src/content-linter/tests/lint-versioning.js b/src/content-linter/tests/lint-versioning.js index 82ea2f2b8a..3e6376aca1 100644 --- a/src/content-linter/tests/lint-versioning.js +++ b/src/content-linter/tests/lint-versioning.js @@ -5,7 +5,7 @@ import semver from 'semver' import featureVersionsSchema from '../lib/feature-versions-schema.js' import { getDeepDataByLanguage } from '#src/data-directory/lib/get-data.js' -import { formatAjvErrors } from '../../../tests/helpers/schemas.js' +import { formatAjvErrors } from '#src/tests/helpers/schemas.js' /* NOTE: This test suite does NOT validate the `versions` frontmatter in content files. diff --git a/src/content-linter/tests/unit/frontmatter-hidden-docs.js b/src/content-linter/tests/unit/frontmatter-hidden-docs.js index dd65436292..3860b15be7 100644 --- a/src/content-linter/tests/unit/frontmatter-hidden-docs.js +++ b/src/content-linter/tests/unit/frontmatter-hidden-docs.js @@ -4,7 +4,7 @@ import { runRule } from '../../lib/init-test.js' import { frontmatterHiddenDocs } from '../../lib/linting-rules/frontmatter-hidden-docs.js' const ACTIONS_FIXTURE = 'src/content-linter/tests/fixtures/actions/hidden.md' -const EARLY_ACCESS_FIXTURE = 'tests/fixtures/content/early-access/secrets/early-days.md' +const EARLY_ACCESS_FIXTURE = 'src/fixtures/fixtures/content/early-access/secrets/early-days.md' const EXPERIMENTAL_FIXTURE = 'src/content-linter/tests/fixtures/actions/experimental.md' const fmOptions = { markdownlintOptions: { frontMatter: null } } diff --git a/src/content-linter/tests/unit/liquid-data-tags.js b/src/content-linter/tests/unit/liquid-data-tags.js index 0d4bd18d53..342e11694b 100644 --- a/src/content-linter/tests/unit/liquid-data-tags.js +++ b/src/content-linter/tests/unit/liquid-data-tags.js @@ -10,7 +10,7 @@ describe(liquidDataReferencesDefined.names.join(' - '), () => { const envVarValueBefore = process.env.ROOT beforeAll(() => { - process.env.ROOT = path.join('tests', 'fixtures') + process.env.ROOT = path.join('src', 'fixtures', 'fixtures') }) afterAll(() => { diff --git a/src/content-linter/tests/unit/liquid-versioning.js b/src/content-linter/tests/unit/liquid-versioning.js index 89a6a1f50b..aa1abf484d 100644 --- a/src/content-linter/tests/unit/liquid-versioning.js +++ b/src/content-linter/tests/unit/liquid-versioning.js @@ -8,7 +8,7 @@ describe(liquidIfTags.names.join(' - '), () => { const envVarValueBefore = process.env.ROOT beforeAll(() => { - process.env.ROOT = path.join('tests', 'fixtures') + process.env.ROOT = path.join('src', 'fixtures', 'fixtures') }) afterAll(() => { @@ -39,7 +39,7 @@ describe(liquidIfVersionTags.names.join(' - '), () => { const envVarValueBefore = process.env.ROOT beforeAll(() => { - process.env.ROOT = path.join('tests', 'fixtures') + process.env.ROOT = path.join('src', 'fixtures', 'fixtures') }) afterAll(() => { diff --git a/tests/rendering/__snapshots__/annotate.js.snap b/src/content-render/tests/__snapshots__/annotate.js.snap similarity index 100% rename from tests/rendering/__snapshots__/annotate.js.snap rename to src/content-render/tests/__snapshots__/annotate.js.snap diff --git a/tests/rendering/annotate.js b/src/content-render/tests/annotate.js similarity index 100% rename from tests/rendering/annotate.js rename to src/content-render/tests/annotate.js diff --git a/src/content-render/tests/data.js b/src/content-render/tests/data.js index 3565600cd9..4e8c8bf753 100644 --- a/src/content-render/tests/data.js +++ b/src/content-render/tests/data.js @@ -3,7 +3,7 @@ import { afterAll, beforeAll, expect, describe, it } from '@jest/globals' import Page from '#src/frame/lib/page.js' import languages from '#src/languages/lib/languages.js' import nonEnterpriseDefaultVersion from '#src/versions/lib/non-enterprise-default-version.js' -import { DataDirectory } from '../../../tests/helpers/data-directory.js' +import { DataDirectory } from '#src/tests/helpers/data-directory.js' describe('data tag', () => { let dd @@ -30,7 +30,7 @@ describe('data tag', () => { it('should render fine if data is found', async () => { const page = await Page.init({ relativePath: 'liquid-tags/good-data-variable.md', - basePath: './tests/fixtures', + basePath: './src/fixtures/fixtures', languageCode: 'en', }) const context = { @@ -47,7 +47,7 @@ describe('data tag', () => { it('should throw if the data tag is used with something unrecognized', async () => { const page = await Page.init({ relativePath: 'liquid-tags/bad-data-variable.md', - basePath: './tests/fixtures', + basePath: './src/fixtures/fixtures', languageCode: 'en', }) const context = { diff --git a/src/content-render/tests/liquid-helpers.js b/src/content-render/tests/liquid-helpers.js index 4496c2cd7f..aecb427e6d 100644 --- a/src/content-render/tests/liquid-helpers.js +++ b/src/content-render/tests/liquid-helpers.js @@ -1,7 +1,7 @@ import { afterAll, jest, beforeAll, expect } from '@jest/globals' import { liquid } from '#src/content-render/index.js' import languages from '#src/languages/lib/languages.js' -import { DataDirectory } from '../../../tests/helpers/data-directory.js' +import { DataDirectory } from '#src/tests/helpers/data-directory.js' describe('liquid helper tags', () => { jest.setTimeout(60 * 1000) diff --git a/src/content-render/tests/render-changed-and-deleted-files.js b/src/content-render/tests/render-changed-and-deleted-files.js index 49ecd36ef8..f069960bd6 100644 --- a/src/content-render/tests/render-changed-and-deleted-files.js +++ b/src/content-render/tests/render-changed-and-deleted-files.js @@ -33,7 +33,7 @@ import path from 'path' import { jest } from '@jest/globals' -import { head, get } from '../../../tests/helpers/e2etest.js' +import { head, get } from '#src/tests/helpers/e2etest.js' import { loadPages } from '#src/frame/lib/page-data.js' const EMPTY = Symbol('EMPTY') diff --git a/tests/fixtures/data/variables/empty.yml b/src/data-directory/README.md similarity index 100% rename from tests/fixtures/data/variables/empty.yml rename to src/data-directory/README.md diff --git a/tests/unit/data-directory/filename-to-key.js b/src/data-directory/tests/filename-to-key.js similarity index 100% rename from tests/unit/data-directory/filename-to-key.js rename to src/data-directory/tests/filename-to-key.js diff --git a/tests/unit/data-directory/fixtures/README.md b/src/data-directory/tests/fixtures/README.md similarity index 100% rename from tests/unit/data-directory/fixtures/README.md rename to src/data-directory/tests/fixtures/README.md diff --git a/tests/unit/data-directory/fixtures/bar.yml b/src/data-directory/tests/fixtures/bar.yml similarity index 100% rename from tests/unit/data-directory/fixtures/bar.yml rename to src/data-directory/tests/fixtures/bar.yml diff --git a/tests/unit/data-directory/fixtures/foo.json b/src/data-directory/tests/fixtures/foo.json similarity index 100% rename from tests/unit/data-directory/fixtures/foo.json rename to src/data-directory/tests/fixtures/foo.json diff --git a/tests/unit/data-directory/fixtures/nested/baz.md b/src/data-directory/tests/fixtures/nested/baz.md similarity index 100% rename from tests/unit/data-directory/fixtures/nested/baz.md rename to src/data-directory/tests/fixtures/nested/baz.md diff --git a/tests/unit/get-data.js b/src/data-directory/tests/get-data.js similarity index 99% rename from tests/unit/get-data.js rename to src/data-directory/tests/get-data.js index 18439f8af4..ae4685dcdd 100644 --- a/tests/unit/get-data.js +++ b/src/data-directory/tests/get-data.js @@ -9,7 +9,7 @@ import { getDeepDataByLanguage, getUIDataMerged, } from '#src/data-directory/lib/get-data.js' -import { DataDirectory } from '../helpers/data-directory.js' +import { DataDirectory } from '#src/tests/helpers/data-directory.js' describe('get-data', () => { let dd diff --git a/tests/content/glossary.js b/src/data-directory/tests/glossary.js similarity index 100% rename from tests/content/glossary.js rename to src/data-directory/tests/glossary.js diff --git a/tests/unit/data-directory/index.js b/src/data-directory/tests/index.js similarity index 100% rename from tests/unit/data-directory/index.js rename to src/data-directory/tests/index.js diff --git a/src/early-access/tests/early-access-rendering.js b/src/early-access/tests/early-access-rendering.js index da63f507ad..51502bd5cf 100644 --- a/src/early-access/tests/early-access-rendering.js +++ b/src/early-access/tests/early-access-rendering.js @@ -3,8 +3,8 @@ import path from 'path' import { expect } from '@jest/globals' -import { testViaActionsOnly } from '../../../tests/helpers/conditional-runs.js' -import { get, getDOM } from '../../../tests/helpers/e2etest.js' +import { testViaActionsOnly } from '#src/tests/helpers/conditional-runs.js' +import { get, getDOM } from '#src/tests/helpers/e2etest.js' describe('cloning early-access', () => { testViaActionsOnly('the content directory exists', async () => { diff --git a/src/early-access/tests/early-access-unit.js b/src/early-access/tests/early-access-unit.js index 395762f3cd..c53d9920ec 100644 --- a/src/early-access/tests/early-access-unit.js +++ b/src/early-access/tests/early-access-unit.js @@ -1,7 +1,7 @@ import { expect, jest, test } from '@jest/globals' -import { get, getDOM } from '../../../tests/helpers/e2etest.js' +import { get, getDOM } from '#src/tests/helpers/e2etest.js' -import { describeIfDocsEarlyAccess } from '../../../tests/helpers/conditional-runs.js' +import { describeIfDocsEarlyAccess } from '#src/tests/helpers/conditional-runs.js' import languages from '#src/languages/lib/languages.js' const VALID_EARLY_ACCESS_URI = '/early-access/github/save-time-with-slash-commands' diff --git a/src/events/tests/middleware.js b/src/events/tests/middleware.js index 04ca692f89..4c8d9ecb3d 100644 --- a/src/events/tests/middleware.js +++ b/src/events/tests/middleware.js @@ -1,5 +1,5 @@ import { expect, jest } from '@jest/globals' -import { post } from '../../../tests/helpers/e2etest.js' +import { post } from '#src/tests/helpers/e2etest.js' describe('POST /events', () => { jest.setTimeout(60 * 1000) diff --git a/tests/PLAYWRIGHT.md b/src/fixtures/PLAYWRIGHT.md similarity index 100% rename from tests/PLAYWRIGHT.md rename to src/fixtures/PLAYWRIGHT.md diff --git a/src/fixtures/README.md b/src/fixtures/README.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/axe.md b/src/fixtures/axe.md similarity index 100% rename from tests/axe.md rename to src/fixtures/axe.md diff --git a/tests/fixtures/README.md b/src/fixtures/fixtures/README.md similarity index 90% rename from tests/fixtures/README.md rename to src/fixtures/fixtures/README.md index 2872ee7d71..6521bb9d4b 100644 --- a/tests/fixtures/README.md +++ b/src/fixtures/fixtures/README.md @@ -17,7 +17,7 @@ have to worry about breaking tests of functionality. ## How to write fixtured based rendering tests -The content is in `tests/fixtures/content/` (and `tests/fixtures/data/`) +The content is in `src/fixtures/fixtures/content/` (and `src/fixtures/fixtures/data/`) is a cut down version of the real `content/` (and `data/`) at the root. It doesn't have nearly as many pages and if you look closely you'll see references and mentions to unrealistic things like "foo" or "HubGit" @@ -26,7 +26,7 @@ with any silly name, the code is modular and good. ### Quickstart -Navigate around in `tests/fixtures/content/` and familiarize yourself +Navigate around in `src/fixtures/fixtures/content/` and familiarize yourself with the directory structure. The only things that are "identical" to the real content is the top-level product names which match the real content. Deeper than the product level, the names and directories can be whatever @@ -47,13 +47,13 @@ action. Feel free to create sub-directories or new files. For example, if it's about end-to-end testing a new custom Liquid tag called `lib/liquid-tags/snacks.js` you create a new test called -`tests/rendering-fixtures/snack.js`. (And equally, you might want to create -`tests/fixtures/content/get-started/foo/snacking.md`) +`src/fixtures/tests/snack.js`. (And equally, you might want to create +`src/fixtures/fixtures/content/get-started/foo/snacking.md`) To run the tests use: ```shell -ROOT=tests/fixtures jest tests/rendering-fixtures/ +ROOT=src/fixtures/fixtures jest src/fixtures/tests ``` ### Exceptions diff --git a/tests/fixtures/article-with-introLinks.md b/src/fixtures/fixtures/article-with-introLinks.md similarity index 100% rename from tests/fixtures/article-with-introLinks.md rename to src/fixtures/fixtures/article-with-introLinks.md diff --git a/tests/fixtures/article-with-mislocalized-frontmatter.md b/src/fixtures/fixtures/article-with-mislocalized-frontmatter.md similarity index 100% rename from tests/fixtures/article-with-mislocalized-frontmatter.md rename to src/fixtures/fixtures/article-with-mislocalized-frontmatter.md diff --git a/tests/fixtures/article-with-redirect-from-string.md b/src/fixtures/fixtures/article-with-redirect-from-string.md similarity index 100% rename from tests/fixtures/article-with-redirect-from-string.md rename to src/fixtures/fixtures/article-with-redirect-from-string.md diff --git a/tests/fixtures/article-with-videos.md b/src/fixtures/fixtures/article-with-videos.md similarity index 100% rename from tests/fixtures/article-with-videos.md rename to src/fixtures/fixtures/article-with-videos.md diff --git a/tests/fixtures/changelog-feed.json b/src/fixtures/fixtures/changelog-feed.json similarity index 100% rename from tests/fixtures/changelog-feed.json rename to src/fixtures/fixtures/changelog-feed.json diff --git a/tests/fixtures/content/actions/category/index.md b/src/fixtures/fixtures/content/actions/category/index.md similarity index 100% rename from tests/fixtures/content/actions/category/index.md rename to src/fixtures/fixtures/content/actions/category/index.md diff --git a/tests/fixtures/content/actions/category/map-topic/article.md b/src/fixtures/fixtures/content/actions/category/map-topic/article.md similarity index 100% rename from tests/fixtures/content/actions/category/map-topic/article.md rename to src/fixtures/fixtures/content/actions/category/map-topic/article.md diff --git a/tests/fixtures/content/actions/category/map-topic/index.md b/src/fixtures/fixtures/content/actions/category/map-topic/index.md similarity index 100% rename from tests/fixtures/content/actions/category/map-topic/index.md rename to src/fixtures/fixtures/content/actions/category/map-topic/index.md diff --git a/tests/fixtures/content/actions/index.md b/src/fixtures/fixtures/content/actions/index.md similarity index 100% rename from tests/fixtures/content/actions/index.md rename to src/fixtures/fixtures/content/actions/index.md diff --git a/tests/fixtures/content/code-security/getting-started/index.md b/src/fixtures/fixtures/content/code-security/getting-started/index.md similarity index 100% rename from tests/fixtures/content/code-security/getting-started/index.md rename to src/fixtures/fixtures/content/code-security/getting-started/index.md diff --git a/tests/fixtures/content/code-security/getting-started/quickstart.md b/src/fixtures/fixtures/content/code-security/getting-started/quickstart.md similarity index 100% rename from tests/fixtures/content/code-security/getting-started/quickstart.md rename to src/fixtures/fixtures/content/code-security/getting-started/quickstart.md diff --git a/tests/fixtures/content/code-security/getting-started/securing-your-organization.md b/src/fixtures/fixtures/content/code-security/getting-started/securing-your-organization.md similarity index 100% rename from tests/fixtures/content/code-security/getting-started/securing-your-organization.md rename to src/fixtures/fixtures/content/code-security/getting-started/securing-your-organization.md diff --git a/tests/fixtures/content/code-security/guides.md b/src/fixtures/fixtures/content/code-security/guides.md similarity index 100% rename from tests/fixtures/content/code-security/guides.md rename to src/fixtures/fixtures/content/code-security/guides.md diff --git a/tests/fixtures/content/code-security/index.md b/src/fixtures/fixtures/content/code-security/index.md similarity index 100% rename from tests/fixtures/content/code-security/index.md rename to src/fixtures/fixtures/content/code-security/index.md diff --git a/tests/fixtures/content/early-access/index.md b/src/fixtures/fixtures/content/early-access/index.md similarity index 100% rename from tests/fixtures/content/early-access/index.md rename to src/fixtures/fixtures/content/early-access/index.md diff --git a/tests/fixtures/content/early-access/secrets/deeper/index.md b/src/fixtures/fixtures/content/early-access/secrets/deeper/index.md similarity index 100% rename from tests/fixtures/content/early-access/secrets/deeper/index.md rename to src/fixtures/fixtures/content/early-access/secrets/deeper/index.md diff --git a/tests/fixtures/content/early-access/secrets/deeper/mariana-trench.md b/src/fixtures/fixtures/content/early-access/secrets/deeper/mariana-trench.md similarity index 100% rename from tests/fixtures/content/early-access/secrets/deeper/mariana-trench.md rename to src/fixtures/fixtures/content/early-access/secrets/deeper/mariana-trench.md diff --git a/tests/fixtures/content/early-access/secrets/early-days.md b/src/fixtures/fixtures/content/early-access/secrets/early-days.md similarity index 100% rename from tests/fixtures/content/early-access/secrets/early-days.md rename to src/fixtures/fixtures/content/early-access/secrets/early-days.md diff --git a/tests/fixtures/content/early-access/secrets/index.md b/src/fixtures/fixtures/content/early-access/secrets/index.md similarity index 100% rename from tests/fixtures/content/early-access/secrets/index.md rename to src/fixtures/fixtures/content/early-access/secrets/index.md diff --git a/tests/fixtures/content/get-started/foo/anchor-autotitling.md b/src/fixtures/fixtures/content/get-started/foo/anchor-autotitling.md similarity index 100% rename from tests/fixtures/content/get-started/foo/anchor-autotitling.md rename to src/fixtures/fixtures/content/get-started/foo/anchor-autotitling.md diff --git a/tests/fixtures/content/get-started/foo/autotitling.md b/src/fixtures/fixtures/content/get-started/foo/autotitling.md similarity index 100% rename from tests/fixtures/content/get-started/foo/autotitling.md rename to src/fixtures/fixtures/content/get-started/foo/autotitling.md diff --git a/tests/fixtures/content/get-started/foo/bar.md b/src/fixtures/fixtures/content/get-started/foo/bar.md similarity index 100% rename from tests/fixtures/content/get-started/foo/bar.md rename to src/fixtures/fixtures/content/get-started/foo/bar.md diff --git a/tests/fixtures/content/get-started/foo/cross-version-linking.md b/src/fixtures/fixtures/content/get-started/foo/cross-version-linking.md similarity index 100% rename from tests/fixtures/content/get-started/foo/cross-version-linking.md rename to src/fixtures/fixtures/content/get-started/foo/cross-version-linking.md diff --git a/tests/fixtures/content/get-started/foo/for-playwright.md b/src/fixtures/fixtures/content/get-started/foo/for-playwright.md similarity index 100% rename from tests/fixtures/content/get-started/foo/for-playwright.md rename to src/fixtures/fixtures/content/get-started/foo/for-playwright.md diff --git a/tests/fixtures/content/get-started/foo/html-short-title.md b/src/fixtures/fixtures/content/get-started/foo/html-short-title.md similarity index 100% rename from tests/fixtures/content/get-started/foo/html-short-title.md rename to src/fixtures/fixtures/content/get-started/foo/html-short-title.md diff --git a/tests/fixtures/content/get-started/foo/index.md b/src/fixtures/fixtures/content/get-started/foo/index.md similarity index 100% rename from tests/fixtures/content/get-started/foo/index.md rename to src/fixtures/fixtures/content/get-started/foo/index.md diff --git a/tests/fixtures/content/get-started/foo/page-with-callout.md b/src/fixtures/fixtures/content/get-started/foo/page-with-callout.md similarity index 100% rename from tests/fixtures/content/get-started/foo/page-with-callout.md rename to src/fixtures/fixtures/content/get-started/foo/page-with-callout.md diff --git a/tests/fixtures/content/get-started/foo/table-with-ifversions.md b/src/fixtures/fixtures/content/get-started/foo/table-with-ifversions.md similarity index 100% rename from tests/fixtures/content/get-started/foo/table-with-ifversions.md rename to src/fixtures/fixtures/content/get-started/foo/table-with-ifversions.md diff --git a/tests/fixtures/content/get-started/foo/typo-autotitling.md b/src/fixtures/fixtures/content/get-started/foo/typo-autotitling.md similarity index 100% rename from tests/fixtures/content/get-started/foo/typo-autotitling.md rename to src/fixtures/fixtures/content/get-started/foo/typo-autotitling.md diff --git a/tests/fixtures/content/get-started/images/images-in-lists.md b/src/fixtures/fixtures/content/get-started/images/images-in-lists.md similarity index 100% rename from tests/fixtures/content/get-started/images/images-in-lists.md rename to src/fixtures/fixtures/content/get-started/images/images-in-lists.md diff --git a/tests/fixtures/content/get-started/images/index.md b/src/fixtures/fixtures/content/get-started/images/index.md similarity index 100% rename from tests/fixtures/content/get-started/images/index.md rename to src/fixtures/fixtures/content/get-started/images/index.md diff --git a/tests/fixtures/content/get-started/images/link-to-image.md b/src/fixtures/fixtures/content/get-started/images/link-to-image.md similarity index 100% rename from tests/fixtures/content/get-started/images/link-to-image.md rename to src/fixtures/fixtures/content/get-started/images/link-to-image.md diff --git a/tests/fixtures/content/get-started/images/single-image.md b/src/fixtures/fixtures/content/get-started/images/single-image.md similarity index 100% rename from tests/fixtures/content/get-started/images/single-image.md rename to src/fixtures/fixtures/content/get-started/images/single-image.md diff --git a/tests/fixtures/content/get-started/index.md b/src/fixtures/fixtures/content/get-started/index.md similarity index 100% rename from tests/fixtures/content/get-started/index.md rename to src/fixtures/fixtures/content/get-started/index.md diff --git a/tests/fixtures/content/get-started/liquid/danger.md b/src/fixtures/fixtures/content/get-started/liquid/danger.md similarity index 100% rename from tests/fixtures/content/get-started/liquid/danger.md rename to src/fixtures/fixtures/content/get-started/liquid/danger.md diff --git a/tests/fixtures/content/get-started/liquid/data.md b/src/fixtures/fixtures/content/get-started/liquid/data.md similarity index 100% rename from tests/fixtures/content/get-started/liquid/data.md rename to src/fixtures/fixtures/content/get-started/liquid/data.md diff --git a/tests/fixtures/content/get-started/liquid/ifversion.md b/src/fixtures/fixtures/content/get-started/liquid/ifversion.md similarity index 100% rename from tests/fixtures/content/get-started/liquid/ifversion.md rename to src/fixtures/fixtures/content/get-started/liquid/ifversion.md diff --git a/tests/fixtures/content/get-started/liquid/index.md b/src/fixtures/fixtures/content/get-started/liquid/index.md similarity index 100% rename from tests/fixtures/content/get-started/liquid/index.md rename to src/fixtures/fixtures/content/get-started/liquid/index.md diff --git a/tests/fixtures/content/get-started/liquid/links-with-liquid.md b/src/fixtures/fixtures/content/get-started/liquid/links-with-liquid.md similarity index 100% rename from tests/fixtures/content/get-started/liquid/links-with-liquid.md rename to src/fixtures/fixtures/content/get-started/liquid/links-with-liquid.md diff --git a/tests/fixtures/content/get-started/liquid/notes.md b/src/fixtures/fixtures/content/get-started/liquid/notes.md similarity index 100% rename from tests/fixtures/content/get-started/liquid/notes.md rename to src/fixtures/fixtures/content/get-started/liquid/notes.md diff --git a/tests/fixtures/content/get-started/liquid/platform-specific.md b/src/fixtures/fixtures/content/get-started/liquid/platform-specific.md similarity index 100% rename from tests/fixtures/content/get-started/liquid/platform-specific.md rename to src/fixtures/fixtures/content/get-started/liquid/platform-specific.md diff --git a/tests/fixtures/content/get-started/liquid/raw.md b/src/fixtures/fixtures/content/get-started/liquid/raw.md similarity index 100% rename from tests/fixtures/content/get-started/liquid/raw.md rename to src/fixtures/fixtures/content/get-started/liquid/raw.md diff --git a/tests/fixtures/content/get-started/liquid/table-row-headers.md b/src/fixtures/fixtures/content/get-started/liquid/table-row-headers.md similarity index 100% rename from tests/fixtures/content/get-started/liquid/table-row-headers.md rename to src/fixtures/fixtures/content/get-started/liquid/table-row-headers.md diff --git a/tests/fixtures/content/get-started/liquid/tips.md b/src/fixtures/fixtures/content/get-started/liquid/tips.md similarity index 100% rename from tests/fixtures/content/get-started/liquid/tips.md rename to src/fixtures/fixtures/content/get-started/liquid/tips.md diff --git a/tests/fixtures/content/get-started/liquid/tool-platform-switcher.md b/src/fixtures/fixtures/content/get-started/liquid/tool-platform-switcher.md similarity index 100% rename from tests/fixtures/content/get-started/liquid/tool-platform-switcher.md rename to src/fixtures/fixtures/content/get-started/liquid/tool-platform-switcher.md diff --git a/tests/fixtures/content/get-started/liquid/tool-specific.md b/src/fixtures/fixtures/content/get-started/liquid/tool-specific.md similarity index 100% rename from tests/fixtures/content/get-started/liquid/tool-specific.md rename to src/fixtures/fixtures/content/get-started/liquid/tool-specific.md diff --git a/tests/fixtures/content/get-started/liquid/warnings.md b/src/fixtures/fixtures/content/get-started/liquid/warnings.md similarity index 100% rename from tests/fixtures/content/get-started/liquid/warnings.md rename to src/fixtures/fixtures/content/get-started/liquid/warnings.md diff --git a/tests/fixtures/content/get-started/liquid/whitespace.md b/src/fixtures/fixtures/content/get-started/liquid/whitespace.md similarity index 100% rename from tests/fixtures/content/get-started/liquid/whitespace.md rename to src/fixtures/fixtures/content/get-started/liquid/whitespace.md diff --git a/tests/fixtures/content/get-started/markdown/code-annotations.md b/src/fixtures/fixtures/content/get-started/markdown/code-annotations.md similarity index 100% rename from tests/fixtures/content/get-started/markdown/code-annotations.md rename to src/fixtures/fixtures/content/get-started/markdown/code-annotations.md diff --git a/tests/fixtures/content/get-started/markdown/index.md b/src/fixtures/fixtures/content/get-started/markdown/index.md similarity index 100% rename from tests/fixtures/content/get-started/markdown/index.md rename to src/fixtures/fixtures/content/get-started/markdown/index.md diff --git a/tests/fixtures/content/get-started/markdown/intro.md b/src/fixtures/fixtures/content/get-started/markdown/intro.md similarity index 100% rename from tests/fixtures/content/get-started/markdown/intro.md rename to src/fixtures/fixtures/content/get-started/markdown/intro.md diff --git a/tests/fixtures/content/get-started/markdown/permissions.md b/src/fixtures/fixtures/content/get-started/markdown/permissions.md similarity index 100% rename from tests/fixtures/content/get-started/markdown/permissions.md rename to src/fixtures/fixtures/content/get-started/markdown/permissions.md diff --git a/tests/fixtures/content/get-started/minitocs/index.md b/src/fixtures/fixtures/content/get-started/minitocs/index.md similarity index 100% rename from tests/fixtures/content/get-started/minitocs/index.md rename to src/fixtures/fixtures/content/get-started/minitocs/index.md diff --git a/tests/fixtures/content/get-started/minitocs/markup-heading.md b/src/fixtures/fixtures/content/get-started/minitocs/markup-heading.md similarity index 100% rename from tests/fixtures/content/get-started/minitocs/markup-heading.md rename to src/fixtures/fixtures/content/get-started/minitocs/markup-heading.md diff --git a/tests/fixtures/content/get-started/minitocs/multiple-headings.md b/src/fixtures/fixtures/content/get-started/minitocs/multiple-headings.md similarity index 100% rename from tests/fixtures/content/get-started/minitocs/multiple-headings.md rename to src/fixtures/fixtures/content/get-started/minitocs/multiple-headings.md diff --git a/tests/fixtures/content/get-started/minitocs/no-heading.md b/src/fixtures/fixtures/content/get-started/minitocs/no-heading.md similarity index 100% rename from tests/fixtures/content/get-started/minitocs/no-heading.md rename to src/fixtures/fixtures/content/get-started/minitocs/no-heading.md diff --git a/tests/fixtures/content/get-started/minitocs/one-heading.md b/src/fixtures/fixtures/content/get-started/minitocs/one-heading.md similarity index 100% rename from tests/fixtures/content/get-started/minitocs/one-heading.md rename to src/fixtures/fixtures/content/get-started/minitocs/one-heading.md diff --git a/tests/fixtures/content/get-started/quickstart/dynamic-title.md b/src/fixtures/fixtures/content/get-started/quickstart/dynamic-title.md similarity index 100% rename from tests/fixtures/content/get-started/quickstart/dynamic-title.md rename to src/fixtures/fixtures/content/get-started/quickstart/dynamic-title.md diff --git a/tests/fixtures/content/get-started/quickstart/github-glossary.md b/src/fixtures/fixtures/content/get-started/quickstart/github-glossary.md similarity index 100% rename from tests/fixtures/content/get-started/quickstart/github-glossary.md rename to src/fixtures/fixtures/content/get-started/quickstart/github-glossary.md diff --git a/tests/fixtures/content/get-started/quickstart/hello-world.md b/src/fixtures/fixtures/content/get-started/quickstart/hello-world.md similarity index 100% rename from tests/fixtures/content/get-started/quickstart/hello-world.md rename to src/fixtures/fixtures/content/get-started/quickstart/hello-world.md diff --git a/tests/fixtures/content/get-started/quickstart/index.md b/src/fixtures/fixtures/content/get-started/quickstart/index.md similarity index 100% rename from tests/fixtures/content/get-started/quickstart/index.md rename to src/fixtures/fixtures/content/get-started/quickstart/index.md diff --git a/tests/fixtures/content/get-started/quickstart/link-rewriting.md b/src/fixtures/fixtures/content/get-started/quickstart/link-rewriting.md similarity index 100% rename from tests/fixtures/content/get-started/quickstart/link-rewriting.md rename to src/fixtures/fixtures/content/get-started/quickstart/link-rewriting.md diff --git a/tests/fixtures/content/get-started/versioning/index.md b/src/fixtures/fixtures/content/get-started/versioning/index.md similarity index 100% rename from tests/fixtures/content/get-started/versioning/index.md rename to src/fixtures/fixtures/content/get-started/versioning/index.md diff --git a/tests/fixtures/content/get-started/versioning/only-fpt.md b/src/fixtures/fixtures/content/get-started/versioning/only-fpt.md similarity index 100% rename from tests/fixtures/content/get-started/versioning/only-fpt.md rename to src/fixtures/fixtures/content/get-started/versioning/only-fpt.md diff --git a/tests/fixtures/content/get-started/versioning/only-ghec-and-ghes.md b/src/fixtures/fixtures/content/get-started/versioning/only-ghec-and-ghes.md similarity index 100% rename from tests/fixtures/content/get-started/versioning/only-ghec-and-ghes.md rename to src/fixtures/fixtures/content/get-started/versioning/only-ghec-and-ghes.md diff --git a/tests/fixtures/content/get-started/versioning/only-ghec.md b/src/fixtures/fixtures/content/get-started/versioning/only-ghec.md similarity index 100% rename from tests/fixtures/content/get-started/versioning/only-ghec.md rename to src/fixtures/fixtures/content/get-started/versioning/only-ghec.md diff --git a/tests/fixtures/content/get-started/video-transcripts/index.md b/src/fixtures/fixtures/content/get-started/video-transcripts/index.md similarity index 100% rename from tests/fixtures/content/get-started/video-transcripts/index.md rename to src/fixtures/fixtures/content/get-started/video-transcripts/index.md diff --git a/tests/fixtures/content/get-started/video-transcripts/transcript--my-awesome-video.md b/src/fixtures/fixtures/content/get-started/video-transcripts/transcript--my-awesome-video.md similarity index 100% rename from tests/fixtures/content/get-started/video-transcripts/transcript--my-awesome-video.md rename to src/fixtures/fixtures/content/get-started/video-transcripts/transcript--my-awesome-video.md diff --git a/tests/fixtures/content/index.md b/src/fixtures/fixtures/content/index.md similarity index 100% rename from tests/fixtures/content/index.md rename to src/fixtures/fixtures/content/index.md diff --git a/tests/fixtures/content/pages/index.md b/src/fixtures/fixtures/content/pages/index.md similarity index 100% rename from tests/fixtures/content/pages/index.md rename to src/fixtures/fixtures/content/pages/index.md diff --git a/tests/fixtures/content/pages/quickstart.md b/src/fixtures/fixtures/content/pages/quickstart.md similarity index 100% rename from tests/fixtures/content/pages/quickstart.md rename to src/fixtures/fixtures/content/pages/quickstart.md diff --git a/tests/fixtures/content/rest/actions/artifacts.md b/src/fixtures/fixtures/content/rest/actions/artifacts.md similarity index 100% rename from tests/fixtures/content/rest/actions/artifacts.md rename to src/fixtures/fixtures/content/rest/actions/artifacts.md diff --git a/tests/fixtures/content/rest/actions/index.md b/src/fixtures/fixtures/content/rest/actions/index.md similarity index 100% rename from tests/fixtures/content/rest/actions/index.md rename to src/fixtures/fixtures/content/rest/actions/index.md diff --git a/tests/fixtures/content/rest/code-scanning.md b/src/fixtures/fixtures/content/rest/code-scanning.md similarity index 100% rename from tests/fixtures/content/rest/code-scanning.md rename to src/fixtures/fixtures/content/rest/code-scanning.md diff --git a/tests/fixtures/content/rest/index.md b/src/fixtures/fixtures/content/rest/index.md similarity index 100% rename from tests/fixtures/content/rest/index.md rename to src/fixtures/fixtures/content/rest/index.md diff --git a/tests/fixtures/content/rest/overview/about-githubs-apis.md b/src/fixtures/fixtures/content/rest/overview/about-githubs-apis.md similarity index 100% rename from tests/fixtures/content/rest/overview/about-githubs-apis.md rename to src/fixtures/fixtures/content/rest/overview/about-githubs-apis.md diff --git a/tests/fixtures/content/rest/overview/index.md b/src/fixtures/fixtures/content/rest/overview/index.md similarity index 100% rename from tests/fixtures/content/rest/overview/index.md rename to src/fixtures/fixtures/content/rest/overview/index.md diff --git a/tests/fixtures/content/search/index.md b/src/fixtures/fixtures/content/search/index.md similarity index 100% rename from tests/fixtures/content/search/index.md rename to src/fixtures/fixtures/content/search/index.md diff --git a/tests/fixtures/data/allowed-topics.js b/src/fixtures/fixtures/data/allowed-topics.js similarity index 100% rename from tests/fixtures/data/allowed-topics.js rename to src/fixtures/fixtures/data/allowed-topics.js diff --git a/tests/fixtures/data/features/volvo.yml b/src/fixtures/fixtures/data/features/volvo.yml similarity index 100% rename from tests/fixtures/data/features/volvo.yml rename to src/fixtures/fixtures/data/features/volvo.yml diff --git a/tests/fixtures/data/glossaries/external.yml b/src/fixtures/fixtures/data/glossaries/external.yml similarity index 100% rename from tests/fixtures/data/glossaries/external.yml rename to src/fixtures/fixtures/data/glossaries/external.yml diff --git a/tests/fixtures/data/learning-tracks/code-security.yml b/src/fixtures/fixtures/data/learning-tracks/code-security.yml similarity index 100% rename from tests/fixtures/data/learning-tracks/code-security.yml rename to src/fixtures/fixtures/data/learning-tracks/code-security.yml diff --git a/tests/fixtures/data/reusables/enterprise_deprecation/deprecation_details.md b/src/fixtures/fixtures/data/reusables/enterprise_deprecation/deprecation_details.md similarity index 100% rename from tests/fixtures/data/reusables/enterprise_deprecation/deprecation_details.md rename to src/fixtures/fixtures/data/reusables/enterprise_deprecation/deprecation_details.md diff --git a/tests/fixtures/data/reusables/enterprise_deprecation/version_was_deprecated.md b/src/fixtures/fixtures/data/reusables/enterprise_deprecation/version_was_deprecated.md similarity index 100% rename from tests/fixtures/data/reusables/enterprise_deprecation/version_was_deprecated.md rename to src/fixtures/fixtures/data/reusables/enterprise_deprecation/version_was_deprecated.md diff --git a/tests/fixtures/data/reusables/enterprise_deprecation/version_will_be_deprecated.md b/src/fixtures/fixtures/data/reusables/enterprise_deprecation/version_will_be_deprecated.md similarity index 100% rename from tests/fixtures/data/reusables/enterprise_deprecation/version_will_be_deprecated.md rename to src/fixtures/fixtures/data/reusables/enterprise_deprecation/version_will_be_deprecated.md diff --git a/src/fixtures/fixtures/data/reusables/gated-features/empty.md b/src/fixtures/fixtures/data/reusables/gated-features/empty.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/fixtures/data/reusables/gated-features/more-info.md b/src/fixtures/fixtures/data/reusables/gated-features/more-info.md similarity index 100% rename from tests/fixtures/data/reusables/gated-features/more-info.md rename to src/fixtures/fixtures/data/reusables/gated-features/more-info.md diff --git a/tests/fixtures/data/reusables/gated-features/not-for-ghes.md b/src/fixtures/fixtures/data/reusables/gated-features/not-for-ghes.md similarity index 100% rename from tests/fixtures/data/reusables/gated-features/not-for-ghes.md rename to src/fixtures/fixtures/data/reusables/gated-features/not-for-ghes.md diff --git a/tests/fixtures/data/reusables/gated-features/pages.md b/src/fixtures/fixtures/data/reusables/gated-features/pages.md similarity index 100% rename from tests/fixtures/data/reusables/gated-features/pages.md rename to src/fixtures/fixtures/data/reusables/gated-features/pages.md diff --git a/tests/fixtures/data/reusables/injectables/multiple_numbers.md b/src/fixtures/fixtures/data/reusables/injectables/multiple_numbers.md similarity index 100% rename from tests/fixtures/data/reusables/injectables/multiple_numbers.md rename to src/fixtures/fixtures/data/reusables/injectables/multiple_numbers.md diff --git a/tests/fixtures/data/reusables/injectables/one_line_numbers.md b/src/fixtures/fixtures/data/reusables/injectables/one_line_numbers.md similarity index 100% rename from tests/fixtures/data/reusables/injectables/one_line_numbers.md rename to src/fixtures/fixtures/data/reusables/injectables/one_line_numbers.md diff --git a/tests/fixtures/data/reusables/injectables/paragraphs.md b/src/fixtures/fixtures/data/reusables/injectables/paragraphs.md similarity index 100% rename from tests/fixtures/data/reusables/injectables/paragraphs.md rename to src/fixtures/fixtures/data/reusables/injectables/paragraphs.md diff --git a/tests/fixtures/data/reusables/injectables/some_table.md b/src/fixtures/fixtures/data/reusables/injectables/some_table.md similarity index 100% rename from tests/fixtures/data/reusables/injectables/some_table.md rename to src/fixtures/fixtures/data/reusables/injectables/some_table.md diff --git a/tests/fixtures/data/reusables/policies/translation.md b/src/fixtures/fixtures/data/reusables/policies/translation.md similarity index 100% rename from tests/fixtures/data/reusables/policies/translation.md rename to src/fixtures/fixtures/data/reusables/policies/translation.md diff --git a/tests/fixtures/data/ui.yml b/src/fixtures/fixtures/data/ui.yml similarity index 100% rename from tests/fixtures/data/ui.yml rename to src/fixtures/fixtures/data/ui.yml diff --git a/src/fixtures/fixtures/data/variables/empty.yml b/src/fixtures/fixtures/data/variables/empty.yml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/fixtures/data/variables/location.yml b/src/fixtures/fixtures/data/variables/location.yml similarity index 100% rename from tests/fixtures/data/variables/location.yml rename to src/fixtures/fixtures/data/variables/location.yml diff --git a/tests/fixtures/data/variables/product.yml b/src/fixtures/fixtures/data/variables/product.yml similarity index 100% rename from tests/fixtures/data/variables/product.yml rename to src/fixtures/fixtures/data/variables/product.yml diff --git a/tests/fixtures/data/variables/release_candidate.yml b/src/fixtures/fixtures/data/variables/release_candidate.yml similarity index 100% rename from tests/fixtures/data/variables/release_candidate.yml rename to src/fixtures/fixtures/data/variables/release_candidate.yml diff --git a/tests/fixtures/default-tool.md b/src/fixtures/fixtures/default-tool.md similarity index 100% rename from tests/fixtures/default-tool.md rename to src/fixtures/fixtures/default-tool.md diff --git a/tests/fixtures/developer-redirects.json b/src/fixtures/fixtures/developer-redirects.json similarity index 100% rename from tests/fixtures/developer-redirects.json rename to src/fixtures/fixtures/developer-redirects.json diff --git a/tests/fixtures/feature-versions-frontmatter.md b/src/fixtures/fixtures/feature-versions-frontmatter.md similarity index 100% rename from tests/fixtures/feature-versions-frontmatter.md rename to src/fixtures/fixtures/feature-versions-frontmatter.md diff --git a/tests/fixtures/github-blog-feed-packages-2021.xml b/src/fixtures/fixtures/github-blog-feed-packages-2021.xml similarity index 100% rename from tests/fixtures/github-blog-feed-packages-2021.xml rename to src/fixtures/fixtures/github-blog-feed-packages-2021.xml diff --git a/tests/fixtures/graphql-redirects.json b/src/fixtures/fixtures/graphql-redirects.json similarity index 100% rename from tests/fixtures/graphql-redirects.json rename to src/fixtures/fixtures/graphql-redirects.json diff --git a/tests/fixtures/liquid-tags/bad-data-variable.md b/src/fixtures/fixtures/liquid-tags/bad-data-variable.md similarity index 100% rename from tests/fixtures/liquid-tags/bad-data-variable.md rename to src/fixtures/fixtures/liquid-tags/bad-data-variable.md diff --git a/tests/fixtures/liquid-tags/good-data-variable.md b/src/fixtures/fixtures/liquid-tags/good-data-variable.md similarity index 100% rename from tests/fixtures/liquid-tags/good-data-variable.md rename to src/fixtures/fixtures/liquid-tags/good-data-variable.md diff --git a/tests/fixtures/liquid-tags/minimal-conditional.md b/src/fixtures/fixtures/liquid-tags/minimal-conditional.md similarity index 100% rename from tests/fixtures/liquid-tags/minimal-conditional.md rename to src/fixtures/fixtures/liquid-tags/minimal-conditional.md diff --git a/tests/fixtures/page-that-does-not-exist-in-translations-dir.md b/src/fixtures/fixtures/page-that-does-not-exist-in-translations-dir.md similarity index 100% rename from tests/fixtures/page-that-does-not-exist-in-translations-dir.md rename to src/fixtures/fixtures/page-that-does-not-exist-in-translations-dir.md diff --git a/tests/fixtures/page-versioned-for-all-enterprise-releases.md b/src/fixtures/fixtures/page-versioned-for-all-enterprise-releases.md similarity index 100% rename from tests/fixtures/page-versioned-for-all-enterprise-releases.md rename to src/fixtures/fixtures/page-versioned-for-all-enterprise-releases.md diff --git a/tests/fixtures/page-versioned-for-next-enterprise-release.md b/src/fixtures/fixtures/page-versioned-for-next-enterprise-release.md similarity index 100% rename from tests/fixtures/page-versioned-for-next-enterprise-release.md rename to src/fixtures/fixtures/page-versioned-for-next-enterprise-release.md diff --git a/tests/fixtures/page-with-frontmatter-error.md b/src/fixtures/fixtures/page-with-frontmatter-error.md similarity index 100% rename from tests/fixtures/page-with-frontmatter-error.md rename to src/fixtures/fixtures/page-with-frontmatter-error.md diff --git a/tests/fixtures/page-with-invalid-product-version.md b/src/fixtures/fixtures/page-with-invalid-product-version.md similarity index 100% rename from tests/fixtures/page-with-invalid-product-version.md rename to src/fixtures/fixtures/page-with-invalid-product-version.md diff --git a/tests/fixtures/page-with-missing-product-versions.md b/src/fixtures/fixtures/page-with-missing-product-versions.md similarity index 100% rename from tests/fixtures/page-with-missing-product-versions.md rename to src/fixtures/fixtures/page-with-missing-product-versions.md diff --git a/tests/fixtures/page-with-optional-attributes.md b/src/fixtures/fixtures/page-with-optional-attributes.md similarity index 100% rename from tests/fixtures/page-with-optional-attributes.md rename to src/fixtures/fixtures/page-with-optional-attributes.md diff --git a/tests/fixtures/page-with-redirects.md b/src/fixtures/fixtures/page-with-redirects.md similarity index 100% rename from tests/fixtures/page-with-redirects.md rename to src/fixtures/fixtures/page-with-redirects.md diff --git a/tests/fixtures/products/actions/some-category/some-article.md b/src/fixtures/fixtures/products/actions/some-category/some-article.md similarity index 100% rename from tests/fixtures/products/actions/some-category/some-article.md rename to src/fixtures/fixtures/products/actions/some-category/some-article.md diff --git a/tests/fixtures/products/admin/some-category/some-article-with-mismatched-versions-frontmatter.md b/src/fixtures/fixtures/products/admin/some-category/some-article-with-mismatched-versions-frontmatter.md similarity index 100% rename from tests/fixtures/products/admin/some-category/some-article-with-mismatched-versions-frontmatter.md rename to src/fixtures/fixtures/products/admin/some-category/some-article-with-mismatched-versions-frontmatter.md diff --git a/tests/fixtures/products/admin/some-category/some-article.md b/src/fixtures/fixtures/products/admin/some-category/some-article.md similarity index 100% rename from tests/fixtures/products/admin/some-category/some-article.md rename to src/fixtures/fixtures/products/admin/some-category/some-article.md diff --git a/tests/fixtures/products/github/some-category/some-article.md b/src/fixtures/fixtures/products/github/some-category/some-article.md similarity index 100% rename from tests/fixtures/products/github/some-category/some-article.md rename to src/fixtures/fixtures/products/github/some-category/some-article.md diff --git a/tests/fixtures/rest-redirects.json b/src/fixtures/fixtures/rest-redirects.json similarity index 100% rename from tests/fixtures/rest-redirects.json rename to src/fixtures/fixtures/rest-redirects.json diff --git a/tests/fixtures/rss-feed.xml b/src/fixtures/fixtures/rss-feed.xml similarity index 100% rename from tests/fixtures/rss-feed.xml rename to src/fixtures/fixtures/rss-feed.xml diff --git a/tests/fixtures/sample-article.md b/src/fixtures/fixtures/sample-article.md similarity index 100% rename from tests/fixtures/sample-article.md rename to src/fixtures/fixtures/sample-article.md diff --git a/tests/fixtures/sample-toc-index.md b/src/fixtures/fixtures/sample-toc-index.md similarity index 100% rename from tests/fixtures/sample-toc-index.md rename to src/fixtures/fixtures/sample-toc-index.md diff --git a/tests/fixtures/short-versions.md b/src/fixtures/fixtures/short-versions.md similarity index 100% rename from tests/fixtures/short-versions.md rename to src/fixtures/fixtures/short-versions.md diff --git a/tests/fixtures/translated-toc-with-no-links-index.md b/src/fixtures/fixtures/translated-toc-with-no-links-index.md similarity index 100% rename from tests/fixtures/translated-toc-with-no-links-index.md rename to src/fixtures/fixtures/translated-toc-with-no-links-index.md diff --git a/tests/fixtures/translations/ja-jp/content/get-started/foo/table-with-ifversions.md b/src/fixtures/fixtures/translations/ja-jp/content/get-started/foo/table-with-ifversions.md similarity index 100% rename from tests/fixtures/translations/ja-jp/content/get-started/foo/table-with-ifversions.md rename to src/fixtures/fixtures/translations/ja-jp/content/get-started/foo/table-with-ifversions.md diff --git a/tests/fixtures/translations/ja-jp/content/get-started/index.md b/src/fixtures/fixtures/translations/ja-jp/content/get-started/index.md similarity index 100% rename from tests/fixtures/translations/ja-jp/content/get-started/index.md rename to src/fixtures/fixtures/translations/ja-jp/content/get-started/index.md diff --git a/tests/fixtures/translations/ja-jp/content/get-started/quickstart/dynamic-title.md b/src/fixtures/fixtures/translations/ja-jp/content/get-started/quickstart/dynamic-title.md similarity index 100% rename from tests/fixtures/translations/ja-jp/content/get-started/quickstart/dynamic-title.md rename to src/fixtures/fixtures/translations/ja-jp/content/get-started/quickstart/dynamic-title.md diff --git a/tests/fixtures/translations/ja-jp/content/get-started/quickstart/hello-world.md b/src/fixtures/fixtures/translations/ja-jp/content/get-started/quickstart/hello-world.md similarity index 100% rename from tests/fixtures/translations/ja-jp/content/get-started/quickstart/hello-world.md rename to src/fixtures/fixtures/translations/ja-jp/content/get-started/quickstart/hello-world.md diff --git a/tests/fixtures/translations/ja-jp/data/reusables/gated-features/more-info.md b/src/fixtures/fixtures/translations/ja-jp/data/reusables/gated-features/more-info.md similarity index 100% rename from tests/fixtures/translations/ja-jp/data/reusables/gated-features/more-info.md rename to src/fixtures/fixtures/translations/ja-jp/data/reusables/gated-features/more-info.md diff --git a/tests/fixtures/translations/ja-jp/data/ui.yml b/src/fixtures/fixtures/translations/ja-jp/data/ui.yml similarity index 100% rename from tests/fixtures/translations/ja-jp/data/ui.yml rename to src/fixtures/fixtures/translations/ja-jp/data/ui.yml diff --git a/tests/fixtures/versionless-redirects.txt b/src/fixtures/fixtures/versionless-redirects.txt similarity index 100% rename from tests/fixtures/versionless-redirects.txt rename to src/fixtures/fixtures/versionless-redirects.txt diff --git a/tests/rendering-fixtures/bad-urls.js b/src/fixtures/tests/bad-urls.js similarity index 90% rename from tests/rendering-fixtures/bad-urls.js rename to src/fixtures/tests/bad-urls.js index e8ab92f194..a45c5365ba 100644 --- a/tests/rendering-fixtures/bad-urls.js +++ b/src/fixtures/tests/bad-urls.js @@ -1,4 +1,4 @@ -import { head } from '../helpers/e2etest.js' +import { head } from '#src/tests/helpers/e2etest.js' describe('bad URLs', () => { test('any URL with /index.md suffix redirects to be without suffix', async () => { diff --git a/tests/rendering-fixtures/breadcrumbs.js b/src/fixtures/tests/breadcrumbs.js similarity index 98% rename from tests/rendering-fixtures/breadcrumbs.js rename to src/fixtures/tests/breadcrumbs.js index a736353356..7998e6de0b 100644 --- a/tests/rendering-fixtures/breadcrumbs.js +++ b/src/fixtures/tests/breadcrumbs.js @@ -1,4 +1,4 @@ -import { getDOM } from '../helpers/e2etest.js' +import { getDOM } from '#src/tests/helpers/e2etest.js' describe('breadcrumbs', () => { test('links always prefixed with language', async () => { diff --git a/tests/rendering-fixtures/callouts.js b/src/fixtures/tests/callouts.js similarity index 94% rename from tests/rendering-fixtures/callouts.js rename to src/fixtures/tests/callouts.js index c7c9f5ca9a..bd10131dab 100644 --- a/tests/rendering-fixtures/callouts.js +++ b/src/fixtures/tests/callouts.js @@ -1,4 +1,4 @@ -import { getDOM } from '../helpers/e2etest.js' +import { getDOM } from '#src/tests/helpers/e2etest.js' describe('callouts', () => { test('article page', async () => { diff --git a/tests/rendering-fixtures/categories-and-map-topic.js b/src/fixtures/tests/categories-and-map-topic.js similarity index 97% rename from tests/rendering-fixtures/categories-and-map-topic.js rename to src/fixtures/tests/categories-and-map-topic.js index 3612036af6..1818d99c5f 100644 --- a/tests/rendering-fixtures/categories-and-map-topic.js +++ b/src/fixtures/tests/categories-and-map-topic.js @@ -1,4 +1,4 @@ -import { getDOM, head } from '../helpers/e2etest.js' +import { getDOM, head } from '#src/tests/helpers/e2etest.js' describe('map topics', () => { test('get-started/quickstart map-topic', async () => { diff --git a/tests/rendering-fixtures/footer.js b/src/fixtures/tests/footer.js similarity index 97% rename from tests/rendering-fixtures/footer.js rename to src/fixtures/tests/footer.js index ae7d5c1504..112dbeae33 100644 --- a/tests/rendering-fixtures/footer.js +++ b/src/fixtures/tests/footer.js @@ -1,6 +1,6 @@ import { jest } from '@jest/globals' -import { getDOM } from '../helpers/e2etest.js' +import { getDOM } from '#src/tests/helpers/e2etest.js' import nonEnterpriseDefaultVersion from '#src/versions/lib/non-enterprise-default-version.js' describe('footer', () => { diff --git a/tests/rendering-fixtures/glossary.js b/src/fixtures/tests/glossary.js similarity index 96% rename from tests/rendering-fixtures/glossary.js rename to src/fixtures/tests/glossary.js index ac9e85c57c..3c0cf82296 100644 --- a/tests/rendering-fixtures/glossary.js +++ b/src/fixtures/tests/glossary.js @@ -1,4 +1,4 @@ -import { getDOMCached as getDOM } from '../helpers/e2etest.js' +import { getDOMCached as getDOM } from '#src/tests/helpers/e2etest.js' describe('glossary', () => { test('headings are sorted alphabetically', async () => { diff --git a/tests/rendering-fixtures/guides.js b/src/fixtures/tests/guides.js similarity index 96% rename from tests/rendering-fixtures/guides.js rename to src/fixtures/tests/guides.js index 0610607adc..35b491d6db 100644 --- a/tests/rendering-fixtures/guides.js +++ b/src/fixtures/tests/guides.js @@ -1,9 +1,9 @@ -import { getDOMCached as getDOM } from '../helpers/e2etest.js' +import { getDOMCached as getDOM } from '#src/tests/helpers/e2etest.js' describe('guides', () => { test("page's title should be document title", async () => { const $ = await getDOM('/code-security/guides') - // This is what you'd find in tests/fixtures/content/code-security/guides.md + // This is what you'd find in src/fixtures/fixtures/content/code-security/guides.md const title = 'Guides for cool security' expect($('title').text()).toMatch(title) expect($('h1').text()).toMatch(title) diff --git a/tests/rendering-fixtures/head.js b/src/fixtures/tests/head.js similarity index 91% rename from tests/rendering-fixtures/head.js rename to src/fixtures/tests/head.js index 3cdd03297b..27fb9d94b9 100644 --- a/tests/rendering-fixtures/head.js +++ b/src/fixtures/tests/head.js @@ -1,4 +1,4 @@ -import { getDOM } from '../helpers/e2etest.js' +import { getDOM } from '#src/tests/helpers/e2etest.js' describe('', () => { test('includes page intro in `description` meta tag', async () => { diff --git a/tests/rendering-fixtures/homepage.js b/src/fixtures/tests/homepage.js similarity index 94% rename from tests/rendering-fixtures/homepage.js rename to src/fixtures/tests/homepage.js index f9a4c6e127..af8126a528 100644 --- a/tests/rendering-fixtures/homepage.js +++ b/src/fixtures/tests/homepage.js @@ -1,6 +1,6 @@ import { expect } from '@jest/globals' -import { get, getDOM } from '../helpers/e2etest.js' +import { get, getDOM } from '#src/tests/helpers/e2etest.js' describe('home page', () => { test('landing area', async () => { diff --git a/tests/rendering-fixtures/images.js b/src/fixtures/tests/images.js similarity index 97% rename from tests/rendering-fixtures/images.js rename to src/fixtures/tests/images.js index c3a02aff98..003703fd3e 100644 --- a/tests/rendering-fixtures/images.js +++ b/src/fixtures/tests/images.js @@ -1,7 +1,7 @@ import { jest } from '@jest/globals' import sharp from 'sharp' -import { get, head, getDOM } from '../../tests/helpers/e2etest.js' +import { get, head, getDOM } from '#src/tests/helpers/e2etest.js' import { MAX_WIDTH } from '#src/content-render/unified/rewrite-asset-img-tags.js' describe('render Markdown image tags', () => { diff --git a/tests/rendering-fixtures/internal-links.js b/src/fixtures/tests/internal-links.js similarity index 98% rename from tests/rendering-fixtures/internal-links.js rename to src/fixtures/tests/internal-links.js index 0b1d1816ff..ee84b97ecb 100644 --- a/tests/rendering-fixtures/internal-links.js +++ b/src/fixtures/tests/internal-links.js @@ -1,4 +1,4 @@ -import { get, getDOM } from '../helpers/e2etest.js' +import { get, getDOM } from '#src/tests/helpers/e2etest.js' import enterpriseServerReleases from '#src/versions/lib/enterprise-server-releases.js' import { allVersions } from '#src/versions/lib/all-versions.js' diff --git a/tests/rendering-fixtures/landing-hero.js b/src/fixtures/tests/landing-hero.js similarity index 94% rename from tests/rendering-fixtures/landing-hero.js rename to src/fixtures/tests/landing-hero.js index 2f4b4b08c9..32bae6a1da 100644 --- a/tests/rendering-fixtures/landing-hero.js +++ b/src/fixtures/tests/landing-hero.js @@ -1,4 +1,4 @@ -import { getDOM } from '../helpers/e2etest.js' +import { getDOM } from '#src/tests/helpers/e2etest.js' describe('product landing page', () => { test('product landing page displays full title', async () => { diff --git a/tests/rendering-fixtures/liquid.js b/src/fixtures/tests/liquid.js similarity index 98% rename from tests/rendering-fixtures/liquid.js rename to src/fixtures/tests/liquid.js index f4ae8ee17e..b478e40e76 100644 --- a/tests/rendering-fixtures/liquid.js +++ b/src/fixtures/tests/liquid.js @@ -1,5 +1,5 @@ import { getDataByLanguage } from '#src/data-directory/lib/get-data.js' -import { getDOM } from '../helpers/e2etest.js' +import { getDOM } from '#src/tests/helpers/e2etest.js' import { supported } from '#src/versions/lib/enterprise-server-releases.js' describe('spotlight', () => { @@ -280,7 +280,7 @@ describe('data tag', () => { expect(codeBlock).toMatch(/One Two Three Four\n/) // On its own, if you look at - // tests/fixtures/data/reusables/injectables/paragraphs.md, you'll + // src/fixtures/fixtures/data/reusables/injectables/paragraphs.md, you'll // see each line is NOT prefixed with whitespace indentation. // But because `{% data reusables.injectables.paragraphs %}` is // inserted with some indentation, that's replicated on every line. @@ -293,7 +293,7 @@ describe('data tag', () => { // of the original HTML, but it doesn't actually matter. What // matters is that within the bullet point, that starts with "Point 1", // it *contains* all the paragraphs - // from tests/fixtures/data/reusables/injectables/paragraphs.md. + // from src/fixtures/fixtures/data/reusables/injectables/paragraphs.md. expect(li.text()).toMatch(/Paragraph one/) expect(li.text()).toMatch(/Paragraph two/) expect(li.text()).toMatch(/Paragraph three/) diff --git a/tests/rendering-fixtures/markdown.js b/src/fixtures/tests/markdown.js similarity index 93% rename from tests/rendering-fixtures/markdown.js rename to src/fixtures/tests/markdown.js index 946b353585..69b2171b12 100644 --- a/tests/rendering-fixtures/markdown.js +++ b/src/fixtures/tests/markdown.js @@ -1,4 +1,4 @@ -import { getDOM } from '../helpers/e2etest.js' +import { getDOM } from '#src/tests/helpers/e2etest.js' describe('markdown rendering', () => { test('markdown in intro', async () => { diff --git a/tests/rendering-fixtures/minitoc.js b/src/fixtures/tests/minitoc.js similarity index 96% rename from tests/rendering-fixtures/minitoc.js rename to src/fixtures/tests/minitoc.js index c1cd94aee4..ea5083f55d 100644 --- a/tests/rendering-fixtures/minitoc.js +++ b/src/fixtures/tests/minitoc.js @@ -1,6 +1,6 @@ import { describe } from '@jest/globals' -import { getDOM } from '../helpers/e2etest.js' +import { getDOM } from '#src/tests/helpers/e2etest.js' describe('minitoc', () => { // TODO disable the mini TOC tests when we replace it with sticky TOC header diff --git a/tests/rendering-fixtures/page-titles.js b/src/fixtures/tests/page-titles.js similarity index 94% rename from tests/rendering-fixtures/page-titles.js rename to src/fixtures/tests/page-titles.js index cddbd5aee9..e88980750b 100644 --- a/tests/rendering-fixtures/page-titles.js +++ b/src/fixtures/tests/page-titles.js @@ -1,5 +1,5 @@ import enterpriseServerReleases from '#src/versions/lib/enterprise-server-releases.js' -import { getDOM } from '../helpers/e2etest.js' +import { getDOM } from '#src/tests/helpers/e2etest.js' describe('page titles', () => { test('homepage', async () => { diff --git a/tests/rendering-fixtures/playwright-a11y.spec.ts b/src/fixtures/tests/playwright-a11y.spec.ts similarity index 100% rename from tests/rendering-fixtures/playwright-a11y.spec.ts rename to src/fixtures/tests/playwright-a11y.spec.ts diff --git a/tests/rendering-fixtures/playwright-rendering.spec.ts b/src/fixtures/tests/playwright-rendering.spec.ts similarity index 100% rename from tests/rendering-fixtures/playwright-rendering.spec.ts rename to src/fixtures/tests/playwright-rendering.spec.ts diff --git a/tests/rendering-fixtures/sidebar.js b/src/fixtures/tests/sidebar.js similarity index 95% rename from tests/rendering-fixtures/sidebar.js rename to src/fixtures/tests/sidebar.js index 5d29ff80d4..15a1f3d65e 100644 --- a/tests/rendering-fixtures/sidebar.js +++ b/src/fixtures/tests/sidebar.js @@ -1,6 +1,6 @@ import { jest } from '@jest/globals' -import { getDOMCached as getDOM } from '../helpers/e2etest.js' +import { getDOMCached as getDOM } from '#src/tests/helpers/e2etest.js' describe('sidebar', () => { jest.setTimeout(10 * 60 * 1000) diff --git a/tests/rendering-fixtures/translations.js b/src/fixtures/tests/translations.js similarity index 94% rename from tests/rendering-fixtures/translations.js rename to src/fixtures/tests/translations.js index aef3cae0c4..fed6c3c324 100644 --- a/tests/rendering-fixtures/translations.js +++ b/src/fixtures/tests/translations.js @@ -1,11 +1,11 @@ import { expect } from '@jest/globals' import { TRANSLATIONS_FIXTURE_ROOT } from '#src/frame/lib/constants.js' -import { getDOM } from '../helpers/e2etest.js' +import { getDOM } from '#src/tests/helpers/e2etest.js' if (!TRANSLATIONS_FIXTURE_ROOT) { let msg = 'You have to set TRANSLATIONS_FIXTURE_ROOT to run this test.' - msg += ' Add TRANSLATIONS_FIXTURE_ROOT=tests/fixtures/translations' + msg += ' Add TRANSLATIONS_FIXTURE_ROOT=src/fixtures/fixtures/translations' throw new Error(msg) } @@ -13,7 +13,7 @@ describe('translations', () => { test('home page', async () => { const $ = await getDOM('/ja') const h1 = $('h1').text() - // You gotta know your tests/fixtures/translations/ja-jp/data/ui.yml + // You gotta know your src/fixtures/fixtures/translations/ja-jp/data/ui.yml expect(h1).toBe('日本 GitHub Docs') const links = $('[data-testid=product] a[href]') diff --git a/tests/rendering-fixtures/versioning.js b/src/fixtures/tests/versioning.js similarity index 97% rename from tests/rendering-fixtures/versioning.js rename to src/fixtures/tests/versioning.js index a6fc422896..925c277ce8 100644 --- a/tests/rendering-fixtures/versioning.js +++ b/src/fixtures/tests/versioning.js @@ -1,5 +1,5 @@ import { expect } from '@jest/globals' -import { getDOM, head } from '../helpers/e2etest.js' +import { getDOM, head } from '#src/tests/helpers/e2etest.js' import { supported } from '#src/versions/lib/enterprise-server-releases.js' describe('article versioning', () => { diff --git a/tests/rendering-fixtures/video-transcripts.js b/src/fixtures/tests/video-transcripts.js similarity index 92% rename from tests/rendering-fixtures/video-transcripts.js rename to src/fixtures/tests/video-transcripts.js index 37932f3e1a..928c6ebfda 100644 --- a/tests/rendering-fixtures/video-transcripts.js +++ b/src/fixtures/tests/video-transcripts.js @@ -1,6 +1,6 @@ import { describe } from '@jest/globals' -import { getDOM } from '../helpers/e2etest.js' +import { getDOM } from '#src/tests/helpers/e2etest.js' describe('transcripts', () => { describe('product landing page', () => { diff --git a/tests/rendering/api.js b/src/frame/tests/api.js similarity index 91% rename from tests/rendering/api.js rename to src/frame/tests/api.js index 56af690374..82de70d3ab 100644 --- a/tests/rendering/api.js +++ b/src/frame/tests/api.js @@ -1,6 +1,6 @@ import { expect, jest, test } from '@jest/globals' -import { get } from '../helpers/e2etest.js' +import { get } from '#src/tests/helpers/e2etest.js' describe('general /api pages', () => { jest.setTimeout(60 * 1000) diff --git a/tests/rendering/block-robots.js b/src/frame/tests/block-robots.js similarity index 100% rename from tests/rendering/block-robots.js rename to src/frame/tests/block-robots.js diff --git a/tests/content/content.js b/src/frame/tests/content.js similarity index 94% rename from tests/content/content.js rename to src/frame/tests/content.js index 1fe675fb43..6585f8e5ff 100644 --- a/tests/content/content.js +++ b/src/frame/tests/content.js @@ -5,7 +5,7 @@ import walk from 'walk-sync' import createTree from '#src/frame/lib/create-tree.js' describe('content files', () => { - test.each(['content', 'tests/fixtures/content'])( + test.each(['content', 'src/fixtures/fixtures/content'])( 'no content files left orphaned without being in the tree in %s', async (contentDir) => { const tree = await createTree(contentDir) diff --git a/tests/rendering/favicons.js b/src/frame/tests/favicons.js similarity index 97% rename from tests/rendering/favicons.js rename to src/frame/tests/favicons.js index 3ad985228c..fdd9f8f232 100644 --- a/tests/rendering/favicons.js +++ b/src/frame/tests/favicons.js @@ -1,7 +1,7 @@ import { expect, jest } from '@jest/globals' import { SURROGATE_ENUMS } from '#src/frame/middleware/set-fastly-surrogate-key.js' -import { get } from '../helpers/e2etest.js' +import { get } from '#src/tests/helpers/e2etest.js' describe('favicon assets', () => { jest.setTimeout(60 * 1000) diff --git a/tests/unit/find-page-middleware.js b/src/frame/tests/find-page-middleware.js similarity index 85% rename from tests/unit/find-page-middleware.js rename to src/frame/tests/find-page-middleware.js index 4c9ba3516a..35df1e6426 100644 --- a/tests/unit/find-page-middleware.js +++ b/src/frame/tests/find-page-middleware.js @@ -43,7 +43,7 @@ describe('find page middleware', () => { req.context.pages = { '/en/foo/bar': await Page.init({ relativePath: 'page-with-redirects.md', - basePath: path.join(__dirname, '../fixtures'), + basePath: path.join(__dirname, '../../../src/fixtures/fixtures'), languageCode: 'en', }), } @@ -72,14 +72,14 @@ describe('find page middleware', () => { req.context.pages = { '/en/page-with-redirects': await Page.init({ relativePath: 'page-with-redirects.md', - basePath: path.join(__dirname, '../fixtures'), + basePath: path.join(__dirname, '../../../src/fixtures/fixtures'), languageCode: 'en', }), } await findPage(req, res, () => {}, { isDev: true, - contentRoot: path.join(__dirname, '../fixtures'), + contentRoot: path.join(__dirname, '../../../src/fixtures/fixtures'), }) expect(req.context.page).toBeInstanceOf(Page) }) @@ -88,14 +88,14 @@ describe('find page middleware', () => { req.context.pages = { '/en/page-with-redirects': await Page.init({ relativePath: 'page-with-redirects.md', - basePath: path.join(__dirname, '../fixtures'), + basePath: path.join(__dirname, '../../../src/fixtures/fixtures'), languageCode: 'en', }), } await findPage(req, res, () => {}, { isDev: true, - contentRoot: path.join(__dirname, '../fixtures'), + contentRoot: path.join(__dirname, '../../../src/fixtures/fixtures'), }) expect(req.context.page).toBeInstanceOf(Page) }) @@ -107,14 +107,14 @@ describe('find page middleware', () => { req.context.pages = { '/en/page-with-redirects': await Page.init({ relativePath: 'page-with-redirects.md', - basePath: path.join(__dirname, '../fixtures'), + basePath: path.join(__dirname, '../../../src/fixtures/fixtures'), languageCode: 'en', }), } await findPage(req, res, () => {}, { isDev: true, - contentRoot: path.join(__dirname, '../fixtures'), + contentRoot: path.join(__dirname, '../../../src/fixtures/fixtures'), }) expect(res._status).toBe(404) expect(res._message).toMatch('') @@ -126,7 +126,7 @@ describe('find page middleware', () => { await findPage(req, res, () => {}, { isDev: true, - contentRoot: path.join(__dirname, '../fixtures'), + contentRoot: path.join(__dirname, '../../../src/fixtures/fixtures'), }) expect(req.context.page).toBe(undefined) }) diff --git a/tests/unit/find-page.js b/src/frame/tests/find-page.js similarity index 91% rename from tests/unit/find-page.js rename to src/frame/tests/find-page.js index 308c87fc77..68f56c6b2f 100644 --- a/tests/unit/find-page.js +++ b/src/frame/tests/find-page.js @@ -11,7 +11,7 @@ describe('find page', () => { test('follows redirects', async () => { const page = await Page.init({ relativePath: 'page-with-redirects.md', - basePath: path.join(__dirname, '../fixtures'), + basePath: path.join(__dirname, '../../../src/fixtures/fixtures'), languageCode: 'en', }) diff --git a/tests/unit/get-remote-json.js b/src/frame/tests/get-remote-json.js similarity index 100% rename from tests/unit/get-remote-json.js rename to src/frame/tests/get-remote-json.js diff --git a/tests/content/gitignore.js b/src/frame/tests/gitignore.js similarity index 100% rename from tests/content/gitignore.js rename to src/frame/tests/gitignore.js diff --git a/tests/rendering/manifest.js b/src/frame/tests/manifest.js similarity index 96% rename from tests/rendering/manifest.js rename to src/frame/tests/manifest.js index b814596724..f611e29bd1 100644 --- a/tests/rendering/manifest.js +++ b/src/frame/tests/manifest.js @@ -1,7 +1,7 @@ import sharp from 'sharp' import { SURROGATE_ENUMS } from '#src/frame/middleware/set-fastly-surrogate-key.js' -import { get, getDOM } from '../helpers/e2etest.js' +import { get, getDOM } from '#src/tests/helpers/e2etest.js' describe('manifest', () => { test('download manifest from HTML and check content', async () => { diff --git a/tests/unit/mini-toc-items.js b/src/frame/tests/mini-toc-items.js similarity index 100% rename from tests/unit/mini-toc-items.js rename to src/frame/tests/mini-toc-items.js diff --git a/tests/routing/next.js b/src/frame/tests/next.js similarity index 91% rename from tests/routing/next.js rename to src/frame/tests/next.js index ff34b355f9..e09aa4d9da 100644 --- a/tests/routing/next.js +++ b/src/frame/tests/next.js @@ -1,6 +1,6 @@ import { describe, expect, jest, test } from '@jest/globals' -import { get } from '../helpers/e2etest.js' +import { get } from '#src/tests/helpers/e2etest.js' describe('bad requests', () => { jest.setTimeout(60 * 1000) diff --git a/tests/unit/page.js b/src/frame/tests/page.js similarity index 90% rename from tests/unit/page.js rename to src/frame/tests/page.js index ee44919765..5722bcded5 100644 --- a/tests/unit/page.js +++ b/src/frame/tests/page.js @@ -19,7 +19,7 @@ const nonEnterpriseDefaultPlan = nonEnterpriseDefaultVersion.split('@')[0] const opts = { relativePath: 'pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches.md', - basePath: path.join(__dirname, '../../content'), + basePath: path.join(__dirname, '../../../content'), languageCode: 'en', } @@ -36,7 +36,7 @@ describe('Page class', () => { beforeAll(async () => { article = await Page.init({ relativePath: 'sample-article.md', - basePath: path.join(__dirname, '../fixtures'), + basePath: path.join(__dirname, '../../../src/fixtures/fixtures'), languageCode: 'en', }) @@ -49,7 +49,7 @@ describe('Page class', () => { tocPage = await Page.init({ relativePath: 'sample-toc-index.md', - basePath: path.join(__dirname, '../fixtures'), + basePath: path.join(__dirname, '../../../src/fixtures/fixtures'), languageCode: 'en', }) }) @@ -75,7 +75,7 @@ describe('Page class', () => { test('renders the expected Enterprise Server versioned content', async () => { const page = await Page.init({ relativePath: 'page-versioned-for-all-enterprise-releases.md', - basePath: path.join(__dirname, '../fixtures'), + basePath: path.join(__dirname, '../../../src/fixtures/fixtures'), languageCode: 'en', }) // set version to the latest enterprise version @@ -119,7 +119,7 @@ describe('Page class', () => { // This fixture has `enterprise-server: '>=3.1'` hardcoded in the frontmatter const page = await Page.init({ relativePath: 'page-versioned-for-next-enterprise-release.md', - basePath: path.join(__dirname, '../fixtures'), + basePath: path.join(__dirname, '../../../src/fixtures/fixtures'), languageCode: 'en', }) // set version to 3.0 @@ -141,21 +141,21 @@ describe('Page class', () => { test('parentProductId getter', async () => { let page = await Page.init({ relativePath: 'github/some-category/some-article.md', - basePath: path.join(__dirname, '../fixtures/products'), + basePath: path.join(__dirname, '../../../src/fixtures/fixtures/products'), languageCode: 'en', }) expect(page.parentProductId).toBe('github') page = await Page.init({ relativePath: 'actions/some-category/some-article.md', - basePath: path.join(__dirname, '../fixtures/products'), + basePath: path.join(__dirname, '../../../src/fixtures/fixtures/products'), languageCode: 'en', }) expect(page.parentProductId).toBe('actions') page = await Page.init({ relativePath: 'admin/some-category/some-article.md', - basePath: path.join(__dirname, '../fixtures/products'), + basePath: path.join(__dirname, '../../../src/fixtures/fixtures/products'), languageCode: 'en', }) expect(page.parentProductId).toBe('admin') @@ -202,7 +202,7 @@ describe('Page class', () => { test('homepage permalinks', async () => { const page = await Page.init({ relativePath: 'index.md', - basePath: path.join(__dirname, '../../content'), + basePath: path.join(__dirname, '../../../content'), languageCode: 'en', }) expect( @@ -221,7 +221,7 @@ describe('Page class', () => { test('permalinks for enterprise-only pages', async () => { const page = await Page.init({ relativePath: 'products/admin/some-category/some-article.md', - basePath: path.join(__dirname, '../fixtures'), + basePath: path.join(__dirname, '../../../src/fixtures/fixtures'), languageCode: 'en', }) expect( @@ -240,7 +240,7 @@ describe('Page class', () => { test('permalinks for non-GitHub.com products without Enterprise versions', async () => { const page = await Page.init({ relativePath: 'products/actions/some-category/some-article.md', - basePath: path.join(__dirname, '../fixtures'), + basePath: path.join(__dirname, '../../../src/fixtures/fixtures'), languageCode: 'en', }) expect( @@ -257,7 +257,7 @@ describe('Page class', () => { beforeEach(async () => { page = await Page.init({ relativePath: 'article-with-videos.md', - basePath: path.join(__dirname, '../fixtures'), + basePath: path.join(__dirname, '../../../src/fixtures/fixtures'), languageCode: 'en', }) }) @@ -286,7 +286,7 @@ describe('Page class', () => { it('includes the links specified in the introLinks frontmatter', async () => { const page = await Page.init({ relativePath: 'article-with-introLinks.md', - basePath: path.join(__dirname, '../fixtures'), + basePath: path.join(__dirname, '../../../src/fixtures/fixtures'), languageCode: 'en', }) @@ -310,7 +310,7 @@ describe('Page class', () => { test('pages that use short names in versions frontmatter', async () => { const page = await Page.init({ relativePath: 'short-versions.md', - basePath: path.join(__dirname, '../fixtures'), + basePath: path.join(__dirname, '../../../src/fixtures/fixtures'), languageCode: 'en', }) expect(page.versions.fpt).toBe('*') @@ -324,7 +324,7 @@ describe('Page class', () => { test('index page', async () => { const page = await Page.init({ relativePath: 'index.md', - basePath: path.join(__dirname, '../../content'), + basePath: path.join(__dirname, '../../../content'), languageCode: 'en', }) expect(page.versions).toEqual({ fpt: '*', ghae: '*', ghec: '*', ghes: '*' }) @@ -333,7 +333,7 @@ describe('Page class', () => { test('enterprise admin index page', async () => { const page = await Page.init({ relativePath: 'admin/index.md', - basePath: path.join(__dirname, '../../content'), + basePath: path.join(__dirname, '../../../content'), languageCode: 'en', }) @@ -358,7 +358,7 @@ describe('Page class', () => { // So we expect to get the versioning from both. const page = await Page.init({ relativePath: 'feature-versions-frontmatter.md', - basePath: path.join(__dirname, '../fixtures'), + basePath: path.join(__dirname, '../../../src/fixtures/fixtures'), languageCode: 'en', }) @@ -386,7 +386,7 @@ describe('Page class', () => { test('page.defaultPlatform frontmatter', async () => { const page = await Page.init({ relativePath: 'actions/some-category/some-article.md', - basePath: path.join(__dirname, '../fixtures/products'), + basePath: path.join(__dirname, '../../../src/fixtures/fixtures/products'), languageCode: 'en', }) expect(page.defaultPlatform).toBeDefined() @@ -398,7 +398,7 @@ describe('Page class', () => { test('page.defaultTool frontmatter', async () => { const page = await Page.init({ relativePath: 'default-tool.md', - basePath: path.join(__dirname, '../fixtures'), + basePath: path.join(__dirname, '../../../src/fixtures/fixtures'), languageCode: 'en', }) expect(page.defaultTool).toBeDefined() @@ -412,7 +412,7 @@ describe('catches errors thrown in Page class', () => { async function getPage() { return await Page.init({ relativePath: 'page-with-frontmatter-error.md', - basePath: path.join(__dirname, '../fixtures'), + basePath: path.join(__dirname, '../../../src/fixtures/fixtures'), languageCode: 'en', }) } @@ -424,7 +424,7 @@ describe('catches errors thrown in Page class', () => { async function getPage() { return await Page.init({ relativePath: 'page-with-missing-product-versions.md', - basePath: path.join(__dirname, '../fixtures'), + basePath: path.join(__dirname, '../../../src/fixtures/fixtures'), languageCode: 'en', }) } @@ -437,7 +437,7 @@ describe('catches errors thrown in Page class', () => { async function getPage() { return await Page.init({ relativePath: 'page-with-invalid-product-version.md', - basePath: path.join(__dirname, '../fixtures'), + basePath: path.join(__dirname, '../../../src/fixtures/fixtures'), languageCode: 'en', }) } @@ -449,7 +449,7 @@ describe('catches errors thrown in Page class', () => { async function getPage() { return await Page.init({ relativePath: 'admin/some-category/some-article-with-mismatched-versions-frontmatter.md', - basePath: path.join(__dirname, '../fixtures/products'), + basePath: path.join(__dirname, '../../../src/fixtures/fixtures/products'), languageCode: 'en', }) } @@ -461,7 +461,7 @@ describe('catches errors thrown in Page class', () => { test("re-rendering set appropriate 'product', 'permissions', 'learningTracks'", async () => { const page = await Page.init({ relativePath: 'page-with-optional-attributes.md', - basePath: path.join(__dirname, '../fixtures'), + basePath: path.join(__dirname, '../../../src/fixtures/fixtures'), languageCode: 'en', }) const context = { diff --git a/tests/unit/pages.js b/src/frame/tests/pages.js similarity index 100% rename from tests/unit/pages.js rename to src/frame/tests/pages.js diff --git a/tests/unit/permalink.js b/src/frame/tests/permalink.js similarity index 100% rename from tests/unit/permalink.js rename to src/frame/tests/permalink.js diff --git a/tests/routing/product-icons.js b/src/frame/tests/product-icons.js similarity index 95% rename from tests/routing/product-icons.js rename to src/frame/tests/product-icons.js index 1a65c91244..01ce2f2dcc 100644 --- a/tests/routing/product-icons.js +++ b/src/frame/tests/product-icons.js @@ -1,6 +1,6 @@ import { describe, jest, test } from '@jest/globals' -import { get, head } from '../helpers/e2etest.js' +import { get, head } from '#src/tests/helpers/e2etest.js' describe('product-icons', () => { jest.setTimeout(60 * 1000) diff --git a/tests/unit/read-frontmatter.js b/src/frame/tests/read-frontmatter.js similarity index 100% rename from tests/unit/read-frontmatter.js rename to src/frame/tests/read-frontmatter.js diff --git a/tests/routing/remote-ip.js b/src/frame/tests/remote-ip.js similarity index 95% rename from tests/routing/remote-ip.js rename to src/frame/tests/remote-ip.js index 57d8cfd121..6435c2e233 100644 --- a/tests/routing/remote-ip.js +++ b/src/frame/tests/remote-ip.js @@ -1,4 +1,4 @@ -import { get } from '../helpers/e2etest.js' +import { get } from '#src/tests/helpers/e2etest.js' import { expect, jest } from '@jest/globals' describe('remote ip debugging', () => { diff --git a/tests/rendering/robots-txt.js b/src/frame/tests/robots-txt.js similarity index 96% rename from tests/rendering/robots-txt.js rename to src/frame/tests/robots-txt.js index dbb575e360..e2c5d6892a 100644 --- a/tests/rendering/robots-txt.js +++ b/src/frame/tests/robots-txt.js @@ -5,7 +5,7 @@ import { SURROGATE_ENUMS, makeLanguageSurrogateKey, } from '#src/frame/middleware/set-fastly-surrogate-key.js' -import { get } from '../helpers/e2etest.js' +import { get } from '#src/tests/helpers/e2etest.js' describe('robots.txt', () => { jest.setTimeout(5 * 60 * 1000) diff --git a/tests/content/secure-files.js b/src/frame/tests/secure-files.js similarity index 100% rename from tests/content/secure-files.js rename to src/frame/tests/secure-files.js diff --git a/tests/rendering/server.js b/src/frame/tests/server.js similarity index 98% rename from tests/rendering/server.js rename to src/frame/tests/server.js index 67ae339a7d..64b2eecff9 100644 --- a/tests/rendering/server.js +++ b/src/frame/tests/server.js @@ -1,6 +1,6 @@ import enterpriseServerReleases from '#src/versions/lib/enterprise-server-releases.js' -import { get, getDOM, head, post } from '../helpers/e2etest.js' -import { describeViaActionsOnly } from '../helpers/conditional-runs.js' +import { get, getDOM, head, post } from '#src/tests/helpers/e2etest.js' +import { describeViaActionsOnly } from '#src/tests/helpers/conditional-runs.js' import { loadPages } from '#src/frame/lib/page-data.js' import CspParse from 'csp-parse' import { diff --git a/tests/content/site-tree.js b/src/frame/tests/site-tree.js similarity index 94% rename from tests/content/site-tree.js rename to src/frame/tests/site-tree.js index 7e7e57f8ea..a3e3f06236 100644 --- a/tests/content/site-tree.js +++ b/src/frame/tests/site-tree.js @@ -1,10 +1,10 @@ import Ajv from 'ajv' import { jest } from '@jest/globals' -import schema from '../helpers/schemas/site-tree-schema.js' +import schema from '#src/tests/helpers/schemas/site-tree-schema.js' import EnterpriseServerReleases from '#src/versions/lib/enterprise-server-releases.js' import { loadSiteTree } from '#src/frame/lib/page-data.js' import nonEnterpriseDefaultVersion from '#src/versions/lib/non-enterprise-default-version.js' -import { formatAjvErrors } from '../helpers/schemas.js' +import { formatAjvErrors } from '#src/tests/helpers/schemas.js' const latestEnterpriseRelease = EnterpriseServerReleases.latest diff --git a/tests/unit/toc-links.js b/src/frame/tests/toc-links.js similarity index 100% rename from tests/unit/toc-links.js rename to src/frame/tests/toc-links.js diff --git a/src/github-apps/tests/rendering.js b/src/github-apps/tests/rendering.js index a46de241b8..dd695309b8 100644 --- a/src/github-apps/tests/rendering.js +++ b/src/github-apps/tests/rendering.js @@ -2,7 +2,7 @@ import { jest, test } from '@jest/globals' import { readFile } from 'fs/promises' import { allVersions } from '#src/versions/lib/all-versions.js' -import { get, getDOM } from '../../../tests/helpers/e2etest.js' +import { get, getDOM } from '#src/tests/helpers/e2etest.js' import { categoriesWithoutSubcategories } from '#src/rest/lib/index.js' import { getAppsData } from '#src/github-apps/lib/index.js' diff --git a/src/graphql/tests/server-rendering.js b/src/graphql/tests/server-rendering.js index 7c463e65f8..bc9dded793 100644 --- a/src/graphql/tests/server-rendering.js +++ b/src/graphql/tests/server-rendering.js @@ -1,4 +1,4 @@ -import { getDOM } from '../../../tests/helpers/e2etest.js' +import { getDOM } from '#src/tests/helpers/e2etest.js' describe('server rendering certain GraphQL pages', () => { test('minitoc hrefs on breaking-changes match', async () => { diff --git a/src/graphql/tests/validate-schema.js b/src/graphql/tests/validate-schema.js index c20f25aabd..1d6bc78dff 100644 --- a/src/graphql/tests/validate-schema.js +++ b/src/graphql/tests/validate-schema.js @@ -3,7 +3,7 @@ import Ajv from 'ajv' import readJsonFile from '#src/frame/lib/read-json-file.js' import { schemaValidator, previewsValidator, upcomingChangesValidator } from '../lib/validator.js' -import { formatAjvErrors } from '../../../tests/helpers/schemas.js' +import { formatAjvErrors } from '#src/tests/helpers/schemas.js' import { allVersions } from '#src/versions/lib/all-versions.js' import { GRAPHQL_DATA_DIR } from '../lib/index.js' diff --git a/src/landings/tests/curated-homepage-links.js b/src/landings/tests/curated-homepage-links.js index afdc1ab59c..9d32c19b1d 100644 --- a/src/landings/tests/curated-homepage-links.js +++ b/src/landings/tests/curated-homepage-links.js @@ -1,4 +1,4 @@ -import { getDOM } from '../../../tests/helpers/e2etest.js' +import { getDOM } from '#src/tests/helpers/e2etest.js' import { jest } from '@jest/globals' describe('curated homepage links', () => { diff --git a/src/landings/tests/featured-links.js b/src/landings/tests/featured-links.js index 26709cf570..9120804764 100644 --- a/src/landings/tests/featured-links.js +++ b/src/landings/tests/featured-links.js @@ -1,6 +1,6 @@ import { jest } from '@jest/globals' -import { getDOM } from '../../../tests/helpers/e2etest.js' +import { getDOM } from '#src/tests/helpers/e2etest.js' import enterpriseServerReleases from '#src/versions/lib/enterprise-server-releases.js' describe('featuredLinks', () => { @@ -34,7 +34,7 @@ describe('featuredLinks', () => { }) // This is an important test because one of the popular links, - // in the front matter of `tests/fixtures/content/index.md`, uses + // in the front matter of `src/fixtures/fixtures/content/index.md`, uses // Liquid to conditionally include with `{% ifversion ghec %}`. test.each(['', '/enterprise-cloud@latest'])( 'never more than 4 links per category in %a', diff --git a/src/landings/tests/homepage.js b/src/landings/tests/homepage.js index 774fc46ab0..fdbbd4ae34 100644 --- a/src/landings/tests/homepage.js +++ b/src/landings/tests/homepage.js @@ -1,6 +1,6 @@ import { expect, jest } from '@jest/globals' -import { getDOM } from '../../../tests/helpers/e2etest.js' +import { getDOM } from '#src/tests/helpers/e2etest.js' describe('rendering the home page(s)', () => { jest.setTimeout(5 * 60 * 1000) diff --git a/src/languages/tests/api-search.js b/src/languages/tests/api-search.js index 7e0aee787e..1110742916 100644 --- a/src/languages/tests/api-search.js +++ b/src/languages/tests/api-search.js @@ -1,7 +1,7 @@ import { jest, test, expect } from '@jest/globals' -import { describeIfElasticsearchURL } from '../../../tests/helpers/conditional-runs.js' -import { get } from '../../../tests/helpers/e2etest.js' +import { describeIfElasticsearchURL } from '#src/tests/helpers/conditional-runs.js' +import { get } from '#src/tests/helpers/e2etest.js' // This suite only runs if $ELASTICSEARCH_URL is set. describeIfElasticsearchURL('search v1 middleware in non-English', () => { diff --git a/src/languages/tests/frame.js b/src/languages/tests/frame.js index 0362953861..b3976acd04 100644 --- a/src/languages/tests/frame.js +++ b/src/languages/tests/frame.js @@ -1,6 +1,6 @@ import { languageKeys } from '#src/languages/lib/languages.js' import { blockIndex } from '#src/frame/middleware/block-robots.js' -import { get, getDOMCached as getDOM } from '../../../tests/helpers/e2etest.js' +import { get, getDOMCached as getDOM } from '#src/tests/helpers/e2etest.js' import Page from '#src/frame/lib/page.js' import { jest } from '@jest/globals' diff --git a/src/languages/tests/glossary.js b/src/languages/tests/glossary.js index 9cac6be55f..2bc2fb82f1 100644 --- a/src/languages/tests/glossary.js +++ b/src/languages/tests/glossary.js @@ -1,5 +1,5 @@ import { languageKeys } from '#src/languages/lib/languages.js' -import { getDOM } from '../../../tests/helpers/e2etest.js' +import { getDOM } from '#src/tests/helpers/e2etest.js' const langs = languageKeys.filter((lang) => lang !== 'en') diff --git a/src/languages/tests/redirects.js b/src/languages/tests/redirects.js index 575dd4c2cf..bba6b6ceae 100644 --- a/src/languages/tests/redirects.js +++ b/src/languages/tests/redirects.js @@ -1,5 +1,5 @@ import { languageKeys } from '#src/languages/lib/languages.js' -import { get } from '../../../tests/helpers/e2etest.js' +import { get } from '#src/tests/helpers/e2etest.js' import { USER_LANGUAGE_COOKIE_NAME } from '#src/frame/lib/constants.js' const langs = languageKeys.filter((lang) => lang !== 'en') diff --git a/src/languages/tests/search.js b/src/languages/tests/search.js index e9dbb31ff8..5d8435217a 100644 --- a/src/languages/tests/search.js +++ b/src/languages/tests/search.js @@ -1,5 +1,5 @@ import { languageKeys } from '#src/languages/lib/languages' -import { get } from '../../../tests/helpers/e2etest.js' +import { get } from '#src/tests/helpers/e2etest.js' const langs = languageKeys.filter((lang) => lang !== 'en') diff --git a/src/learning-track/tests/lint-data.js b/src/learning-track/tests/lint-data.js index 1b407e4ac0..059830ef70 100644 --- a/src/learning-track/tests/lint-data.js +++ b/src/learning-track/tests/lint-data.js @@ -1,7 +1,7 @@ import { loadPages, loadPageMap } from '#src/frame/lib/page-data.js' import loadRedirects from '#src/redirects/lib/precompile.js' import { getDeepDataByLanguage } from '#src/data-directory/lib/get-data.js' -import { checkURL } from '../../../tests/helpers/check-url.js' +import { checkURL } from '#src/tests/helpers/check-url.js' const pageList = await loadPages(undefined, ['en']) const pages = await loadPageMap(pageList) diff --git a/src/learning-track/tests/validate-schema.js b/src/learning-track/tests/validate-schema.js index cddccbec56..333e5becac 100644 --- a/src/learning-track/tests/validate-schema.js +++ b/src/learning-track/tests/validate-schema.js @@ -5,7 +5,7 @@ import { jest } from '@jest/globals' import { liquid } from '#src/content-render/index.js' import learningTracksSchema from '../lib/learning-tracks-schema.js' -import { formatAjvErrors } from '../../../tests/helpers/schemas.js' +import { formatAjvErrors } from '#src/tests/helpers/schemas.js' import { ajvValidate } from '#src/tests/lib/ajv-validate.js' const learningTrackRootPath = 'data/learning-tracks' diff --git a/src/links/scripts/update-internal-links.js b/src/links/scripts/update-internal-links.js index ca3ebacdc5..38a1081ff3 100755 --- a/src/links/scripts/update-internal-links.js +++ b/src/links/scripts/update-internal-links.js @@ -55,7 +55,7 @@ async function main(files, opts) { !( file.startsWith('content') || file.startsWith('data') || - file.startsWith('tests/fixtures') + file.startsWith('src/fixtures/fixtures') ) ) { throw new Error(`${file} must be a content or data filepath`) diff --git a/src/pageinfo/tests/pageinfo.js b/src/pageinfo/tests/pageinfo.js index d53a4a1a69..926873516a 100644 --- a/src/pageinfo/tests/pageinfo.js +++ b/src/pageinfo/tests/pageinfo.js @@ -1,6 +1,6 @@ import { beforeAll } from '@jest/globals' -import { get } from '../../../tests/helpers/e2etest.js' +import { get } from '#src/tests/helpers/e2etest.js' import { SURROGATE_ENUMS } from '#src/frame/middleware/set-fastly-surrogate-key.js' import { latest } from '#src/versions/lib/enterprise-server-releases.js' diff --git a/src/products/README.md b/src/products/README.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/unit/product-names.js b/src/products/tests/product-names.js similarity index 100% rename from tests/unit/product-names.js rename to src/products/tests/product-names.js diff --git a/tests/unit/products.js b/src/products/tests/products.js similarity index 83% rename from tests/unit/products.js rename to src/products/tests/products.js index 4d6621cdb6..0c87ac34c8 100644 --- a/tests/unit/products.js +++ b/src/products/tests/products.js @@ -1,7 +1,7 @@ import Ajv from 'ajv' import { productMap } from '#src/products/lib/all-products.js' -import { formatAjvErrors } from '../helpers/schemas.js' -import schema from '../helpers/schemas/products-schema.js' +import { formatAjvErrors } from '#src/tests/helpers/schemas.js' +import schema from '#src/tests/helpers/schemas/products-schema.js' const ajv = new Ajv({ allErrors: true }) const validate = ajv.compile(schema) diff --git a/src/redirects/README.md b/src/redirects/README.md index c3d459637e..eeb1ab304a 100644 --- a/src/redirects/README.md +++ b/src/redirects/README.md @@ -69,4 +69,4 @@ Here's how the `src/archives/middleware/archived-enterprise-versions.js` fallbac Redirect tests are mainly found in `tests/routing/*`, with some additional tests in `tests/rendering/server.js`. -The `tests/fixtures/*` directory includes `developer-redirects.json`, `graphql-redirects.json`, and `rest-redirects.json`. +The `src/fixtures/fixtures/*` directory includes `developer-redirects.json`, `graphql-redirects.json`, and `rest-redirects.json`. diff --git a/tests/routing/redirects.js b/src/redirects/tests/redirects.js similarity index 99% rename from tests/routing/redirects.js rename to src/redirects/tests/redirects.js index 4f39ddbd59..72e66fd73c 100644 --- a/tests/routing/redirects.js +++ b/src/redirects/tests/redirects.js @@ -7,7 +7,7 @@ import enterpriseServerReleases, { deprecatedWithFunctionalRedirects, } from '#src/versions/lib/enterprise-server-releases.js' import Page from '#src/frame/lib/page.js' -import { get, head } from '../helpers/e2etest.js' +import { get, head } from '#src/tests/helpers/e2etest.js' import versionSatisfiesRange from '#src/versions/lib/version-satisfies-range.js' const __dirname = path.dirname(fileURLToPath(import.meta.url)) @@ -25,7 +25,7 @@ describe('redirects', () => { const page = await Page.init({ relativePath: 'pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches.md', - basePath: path.join(__dirname, '../../content'), + basePath: path.join(__dirname, '../../../content'), languageCode: 'en', }) const pageRedirects = page.buildRedirects() @@ -35,7 +35,7 @@ describe('redirects', () => { test('dotcom homepage page.buildRedirects()', async () => { const page = await Page.init({ relativePath: 'issues/index.md', - basePath: path.join(__dirname, '../../content'), + basePath: path.join(__dirname, '../../../content'), languageCode: 'en', }) const pageRedirects = page.buildRedirects() diff --git a/src/redirects/tests/routing/developer-site-redirects.js b/src/redirects/tests/routing/developer-site-redirects.js index ee5064edf4..2e82ae21f4 100644 --- a/src/redirects/tests/routing/developer-site-redirects.js +++ b/src/redirects/tests/routing/developer-site-redirects.js @@ -1,7 +1,7 @@ import { jest } from '@jest/globals' import path from 'path' import enterpriseServerReleases from '#src/versions/lib/enterprise-server-releases.js' -import { get } from '../../../../tests/helpers/e2etest.js' +import { get } from '#src/tests/helpers/e2etest.js' import readJsonFile from '#src/frame/lib/read-json-file.js' jest.useFakeTimers({ legacyFakeTimers: true }) @@ -101,9 +101,9 @@ describe('developer redirects', () => { describe('fixtures', () => { test.each(['developer', 'rest', 'graphql'])('%s redirects', async (label) => { const FIXTURES = { - developer: './tests/fixtures/developer-redirects.json', - rest: './tests/fixtures/rest-redirects.json', - graphql: './tests/fixtures/graphql-redirects.json', + developer: './src/fixtures/fixtures/developer-redirects.json', + rest: './src/fixtures/fixtures/rest-redirects.json', + graphql: './src/fixtures/fixtures/graphql-redirects.json', } if (!(label in FIXTURES)) throw new Error('unrecognized label') const fixtures = readJsonFile(FIXTURES[label]) diff --git a/src/redirects/tests/routing/redirect-exceptions.js b/src/redirects/tests/routing/redirect-exceptions.js index 0e02414f04..14a5035856 100644 --- a/src/redirects/tests/routing/redirect-exceptions.js +++ b/src/redirects/tests/routing/redirect-exceptions.js @@ -2,7 +2,7 @@ import { fileURLToPath } from 'url' import path from 'path' import { jest } from '@jest/globals' -import { get } from '../../../../tests/helpers/e2etest.js' +import { get } from '#src/tests/helpers/e2etest.js' import getExceptionRedirects from '../../lib/exception-redirects.js' import { latest } from '#src/versions/lib/enterprise-server-releases.js' diff --git a/src/redirects/tests/routing/top-developer-site-path-redirects.js b/src/redirects/tests/routing/top-developer-site-path-redirects.js index 56010d3a64..37851f5ad7 100644 --- a/src/redirects/tests/routing/top-developer-site-path-redirects.js +++ b/src/redirects/tests/routing/top-developer-site-path-redirects.js @@ -1,6 +1,6 @@ import { jest } from '@jest/globals' -import { head } from '../../../../tests/helpers/e2etest.js' +import { head } from '#src/tests/helpers/e2etest.js' jest.useFakeTimers({ legacyFakeTimers: true }) diff --git a/src/redirects/tests/routing/versionless-redirects.js b/src/redirects/tests/routing/versionless-redirects.js index 909bb12b39..5bce43157e 100644 --- a/src/redirects/tests/routing/versionless-redirects.js +++ b/src/redirects/tests/routing/versionless-redirects.js @@ -1,6 +1,6 @@ import { jest } from '@jest/globals' -import { get } from '../../../../tests/helpers/e2etest.js' +import { get } from '#src/tests/helpers/e2etest.js' import getExceptionRedirects from '../../lib/exception-redirects.js' import { latest } from '#src/versions/lib/enterprise-server-releases.js' @@ -10,7 +10,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url)) const VERSIONLESS_REDIRECTS_FILE = path.join( __dirname, - '../../../../tests/fixtures/versionless-redirects.txt', + '../../../../src/fixtures/fixtures/versionless-redirects.txt', ) // This test checks the default versioning redirect fallbacks described in lib/all-versions.js. diff --git a/src/release-notes/tests/release-notes-1.js b/src/release-notes/tests/release-notes-1.js index 67202bf128..28a42897ce 100644 --- a/src/release-notes/tests/release-notes-1.js +++ b/src/release-notes/tests/release-notes-1.js @@ -1,7 +1,7 @@ import { jest } from '@jest/globals' import nock from 'nock' -import { get, getDOM } from '../../../tests/helpers/e2etest.js' +import { get, getDOM } from '#src/tests/helpers/e2etest.js' import enterpriseServerReleases from '#src/versions/lib/enterprise-server-releases.js' jest.useFakeTimers({ legacyFakeTimers: true }) diff --git a/src/release-notes/tests/release-notes.js b/src/release-notes/tests/release-notes.js index a06c8e1526..eb2267f554 100644 --- a/src/release-notes/tests/release-notes.js +++ b/src/release-notes/tests/release-notes.js @@ -1,7 +1,7 @@ import { describe, jest } from '@jest/globals' import enterpriseServerReleases from '#src/versions/lib/enterprise-server-releases.js' -import { get } from '../../../tests/helpers/e2etest.js' +import { get } from '#src/tests/helpers/e2etest.js' import Page from '#src/frame/lib/page.js' // The English content page's `versions:` frontmatter is the source diff --git a/src/release-notes/tests/validate-schema.js b/src/release-notes/tests/validate-schema.js index b05052bac4..841b3889cd 100644 --- a/src/release-notes/tests/validate-schema.js +++ b/src/release-notes/tests/validate-schema.js @@ -4,7 +4,7 @@ import walk from 'walk-sync' import { jest } from '@jest/globals' import releaseNotesSchema from '../lib/release-notes-schema.js' -import { formatAjvErrors } from '../../../tests/helpers/schemas.js' +import { formatAjvErrors } from '#src/tests/helpers/schemas.js' import { ajvValidate } from '#src/tests/lib/ajv-validate.js' const ghesReleaseNoteRootPath = 'data/release-notes' diff --git a/src/rest/tests/fixtures/create-rest-examples.js b/src/rest/fixtures/create-rest-examples.js similarity index 100% rename from src/rest/tests/fixtures/create-rest-examples.js rename to src/rest/fixtures/create-rest-examples.js diff --git a/src/rest/tests/api.js b/src/rest/tests/api.js index 7d5d3229de..17418d570e 100644 --- a/src/rest/tests/api.js +++ b/src/rest/tests/api.js @@ -2,7 +2,7 @@ import fs from 'fs' import { describe, expect } from '@jest/globals' -import { get } from '../../../tests/helpers/e2etest.js' +import { get } from '#src/tests/helpers/e2etest.js' import { SURROGATE_ENUMS, makeLanguageSurrogateKey, diff --git a/src/rest/tests/create-rest-examples.js b/src/rest/tests/create-rest-examples.js index 38345d12bf..b59d4b9e17 100644 --- a/src/rest/tests/create-rest-examples.js +++ b/src/rest/tests/create-rest-examples.js @@ -7,7 +7,7 @@ import { noResponse, oneToOne, matchingTags, -} from './fixtures/create-rest-examples.js' +} from '../fixtures/create-rest-examples.js' describe('rest example requests and responses', () => { // If there is a request with no request body parameters and all of diff --git a/src/rest/tests/rendering.js b/src/rest/tests/rendering.js index 8888db3b33..868c011182 100644 --- a/src/rest/tests/rendering.js +++ b/src/rest/tests/rendering.js @@ -1,7 +1,7 @@ import { jest, test } from '@jest/globals' import { slug } from 'github-slugger' -import { get, getDOM } from '../../../tests/helpers/e2etest.js' +import { get, getDOM } from '#src/tests/helpers/e2etest.js' import { isApiVersioned, allVersions } from '#src/versions/lib/all-versions.js' import { getDiffOpenAPIContentRest } from '../scripts/test-open-api-schema.js' import getRest from '#src/rest/lib/index.js' diff --git a/src/search/tests/api-search.js b/src/search/tests/api-search.js index 6550d303cd..8864eff741 100644 --- a/src/search/tests/api-search.js +++ b/src/search/tests/api-search.js @@ -13,8 +13,8 @@ import { jest, test, expect } from '@jest/globals' -import { describeIfElasticsearchURL } from '../../../tests/helpers/conditional-runs.js' -import { get } from '../../../tests/helpers/e2etest.js' +import { describeIfElasticsearchURL } from '#src/tests/helpers/conditional-runs.js' +import { get } from '#src/tests/helpers/e2etest.js' if (!process.env.ELASTICSEARCH_URL) { console.warn( diff --git a/src/search/tests/rendering.js b/src/search/tests/rendering.js index 613e51cc37..e9769fefdf 100644 --- a/src/search/tests/rendering.js +++ b/src/search/tests/rendering.js @@ -13,8 +13,8 @@ import { jest, test, expect } from '@jest/globals' -import { describeIfElasticsearchURL } from '../../../tests/helpers/conditional-runs.js' -import { get, getDOM } from '../../../tests/helpers/e2etest.js' +import { describeIfElasticsearchURL } from '#src/tests/helpers/conditional-runs.js' +import { get, getDOM } from '#src/tests/helpers/e2etest.js' import { SURROGATE_ENUMS } from '#src/frame/middleware/set-fastly-surrogate-key.js' if (!process.env.ELASTICSEARCH_URL) { diff --git a/src/search/tests/search.js b/src/search/tests/search.js index 691b28a60a..a0aee5ff4d 100644 --- a/src/search/tests/search.js +++ b/src/search/tests/search.js @@ -1,6 +1,6 @@ import { expect, jest } from '@jest/globals' -import { getDOM } from '../../../tests/helpers/e2etest.js' +import { getDOM } from '#src/tests/helpers/e2etest.js' describe('search results page', () => { jest.setTimeout(5 * 60 * 1000) diff --git a/src/secret-scanning/tests/validate-schema.js b/src/secret-scanning/tests/validate-schema.js index 8f46903f3e..02c182881b 100644 --- a/src/secret-scanning/tests/validate-schema.js +++ b/src/secret-scanning/tests/validate-schema.js @@ -3,7 +3,7 @@ import yaml from 'js-yaml' import { jest } from '@jest/globals' import { ajvValidate } from '#src/tests/lib/ajv-validate.js' -import { formatAjvErrors } from '../../../tests/helpers/schemas.js' +import { formatAjvErrors } from '#src/tests/helpers/schemas.js' import secretScanningSchema from '../lib/secret-scanning-schema.js' jest.useFakeTimers({ legacyFakeTimers: true }) diff --git a/src/shielding/tests/invalid-querystring-values.js b/src/shielding/tests/invalid-querystring-values.js index 3ea984a4f8..b40bdd7c8c 100644 --- a/src/shielding/tests/invalid-querystring-values.js +++ b/src/shielding/tests/invalid-querystring-values.js @@ -1,4 +1,4 @@ -import { get } from '../../../tests/helpers/e2etest.js' +import { get } from '#src/tests/helpers/e2etest.js' describe('invalid query string values', () => { test.each(['platform', 'tool'])('%a key', async (key) => { diff --git a/src/shielding/tests/invalid-querystrings.js b/src/shielding/tests/invalid-querystrings.js index 5b52b5a9ab..66eb4185aa 100644 --- a/src/shielding/tests/invalid-querystrings.js +++ b/src/shielding/tests/invalid-querystrings.js @@ -1,4 +1,4 @@ -import { get } from '../../../tests/helpers/e2etest.js' +import { get } from '#src/tests/helpers/e2etest.js' import { MAX_UNFAMILIAR_KEYS_BAD_REQUEST, diff --git a/src/shielding/tests/shielding.js b/src/shielding/tests/shielding.js index 7a55b9d0f8..8edaff43ac 100644 --- a/src/shielding/tests/shielding.js +++ b/src/shielding/tests/shielding.js @@ -1,6 +1,6 @@ import { SURROGATE_ENUMS } from '#src/frame/middleware/set-fastly-surrogate-key.js' // import { setFastlySurrogateKey } from '#src/frame/middleware/set-fastly-surrogate-key.js' -import { get } from '../../../tests/helpers/e2etest.js' +import { get } from '#src/tests/helpers/e2etest.js' describe('honeypotting', () => { test('any GET with survey-vote and survey-token query strings is 400', async () => { diff --git a/tests/README.md b/src/tests/README-1.md similarity index 100% rename from tests/README.md rename to src/tests/README-1.md diff --git a/tests/helpers/action-mocks.js b/src/tests/helpers/action-mocks.js similarity index 100% rename from tests/helpers/action-mocks.js rename to src/tests/helpers/action-mocks.js diff --git a/tests/helpers/caching-headers.js b/src/tests/helpers/caching-headers.js similarity index 100% rename from tests/helpers/caching-headers.js rename to src/tests/helpers/caching-headers.js diff --git a/tests/helpers/check-url.js b/src/tests/helpers/check-url.js similarity index 100% rename from tests/helpers/check-url.js rename to src/tests/helpers/check-url.js diff --git a/tests/helpers/conditional-runs.js b/src/tests/helpers/conditional-runs.js similarity index 100% rename from tests/helpers/conditional-runs.js rename to src/tests/helpers/conditional-runs.js diff --git a/tests/helpers/data-directory.js b/src/tests/helpers/data-directory.js similarity index 100% rename from tests/helpers/data-directory.js rename to src/tests/helpers/data-directory.js diff --git a/tests/helpers/e2etest.js b/src/tests/helpers/e2etest.js similarity index 100% rename from tests/helpers/e2etest.js rename to src/tests/helpers/e2etest.js diff --git a/tests/helpers/schemas.js b/src/tests/helpers/schemas.js similarity index 100% rename from tests/helpers/schemas.js rename to src/tests/helpers/schemas.js diff --git a/tests/helpers/schemas/products-schema.js b/src/tests/helpers/schemas/products-schema.js similarity index 100% rename from tests/helpers/schemas/products-schema.js rename to src/tests/helpers/schemas/products-schema.js diff --git a/tests/helpers/schemas/site-tree-schema.js b/src/tests/helpers/schemas/site-tree-schema.js similarity index 100% rename from tests/helpers/schemas/site-tree-schema.js rename to src/tests/helpers/schemas/site-tree-schema.js diff --git a/tests/helpers/schemas/versions-schema.js b/src/tests/helpers/schemas/versions-schema.js similarity index 100% rename from tests/helpers/schemas/versions-schema.js rename to src/tests/helpers/schemas/versions-schema.js diff --git a/tests/helpers/script-data.js b/src/tests/helpers/script-data.js similarity index 100% rename from tests/helpers/script-data.js rename to src/tests/helpers/script-data.js diff --git a/src/tests/scripts/copy-fixture-data.js b/src/tests/scripts/copy-fixture-data.js index 2bd07e87eb..da36b7db94 100755 --- a/src/tests/scripts/copy-fixture-data.js +++ b/src/tests/scripts/copy-fixture-data.js @@ -29,7 +29,7 @@ const MANDATORY_FILES = [ 'data/variables/release_candidate.yml', ] -const DESTINATION = path.resolve('tests/fixtures') +const DESTINATION = path.resolve('src/fixtures/fixtures') program .description('Make sure the test fixtures have up-to-date data from the real content') diff --git a/src/versions/tests/versions.js b/src/versions/tests/versions.js index 3c72067c1a..52859d93da 100644 --- a/src/versions/tests/versions.js +++ b/src/versions/tests/versions.js @@ -3,9 +3,9 @@ import Ajv from 'ajv' import { allVersions } from '#src/versions/lib/all-versions.js' import { latest } from '#src/versions/lib/enterprise-server-releases.js' -import schema from '../../../tests/helpers/schemas/versions-schema.js' +import schema from '#src/tests/helpers/schemas/versions-schema.js' import nonEnterpriseDefaultVersion from '#src/versions/lib/non-enterprise-default-version.js' -import { formatAjvErrors } from '../../../tests/helpers/schemas.js' +import { formatAjvErrors } from '#src/tests/helpers/schemas.js' jest.useFakeTimers({ legacyFakeTimers: true }) diff --git a/src/webhooks/tests/api.js b/src/webhooks/tests/api.js index fd582a6d30..674adc77ad 100644 --- a/src/webhooks/tests/api.js +++ b/src/webhooks/tests/api.js @@ -1,4 +1,4 @@ -import { get } from '../../../tests/helpers/e2etest.js' +import { get } from '#src/tests/helpers/e2etest.js' import { SURROGATE_ENUMS, makeLanguageSurrogateKey, diff --git a/src/webhooks/tests/rendering.js b/src/webhooks/tests/rendering.js index 4326390765..0784119059 100644 --- a/src/webhooks/tests/rendering.js +++ b/src/webhooks/tests/rendering.js @@ -1,5 +1,5 @@ import { expect, jest } from '@jest/globals' -import { getDOM } from '../../../tests/helpers/e2etest.js' +import { getDOM } from '#src/tests/helpers/e2etest.js' import { allVersions } from '#src/versions/lib/all-versions.js' import { getWebhooks } from '../lib/index.js'