Skip to content

Commit 0c490d9

Browse files
authored
Src content render tests (github#38701)
1 parent 3a4419b commit 0c490d9

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,13 @@ jobs:
4343
{ name: 'automated-pipelines', path: 'src/automated-pipelines/tests', },
4444
{ name: 'content', path: 'tests/content', },
4545
// { name: 'content-linter', path: 'src/content-linter/tests', },
46+
{ name: 'content-render', path: 'src/content-render/tests', },
4647
{ name: 'events', path: 'src/events/tests', },
4748
{ name: 'ghes-releases', path: 'src/ghes-releases/tests', },
4849
{ name: 'github-apps', path: 'src/github-apps/tests', },
4950
{ name: 'graphql', path: 'src/graphql/tests', },
5051
{ name: 'landings', path: 'src/landings/tests', },
52+
// { name: 'learning-track', path: 'src/learning-track/tests', },
5153
{ name: 'linting', path: 'src/content-linter/tests', },
5254
{ name: 'observability', path: 'src/observability/tests' },
5355
{ name: 'pageinfo', path: 'src/pageinfo/tests', },

src/content-render/tests/data.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
1-
import { fileURLToPath } from 'url'
2-
import path from 'path'
3-
41
import { afterAll, beforeAll, expect, describe, it } from '@jest/globals'
52

63
import Page from '../../../lib/page.js'
74
import languages from '../../../lib/languages.js'
85
import nonEnterpriseDefaultVersion from '../../../lib/non-enterprise-default-version.js'
96
import { DataDirectory } from '../../../tests/helpers/data-directory.js'
107

11-
const __dirname = path.dirname(fileURLToPath(import.meta.url))
12-
138
describe('data tag', () => {
149
let dd
1510
const enDirBefore = languages.en.dir
@@ -35,7 +30,7 @@ describe('data tag', () => {
3530
it('should render fine if data is found', async () => {
3631
const page = await Page.init({
3732
relativePath: 'liquid-tags/good-data-variable.md',
38-
basePath: path.join(__dirname, '../../fixtures'),
33+
basePath: './tests/fixtures',
3934
languageCode: 'en',
4035
})
4136
const context = {
@@ -52,7 +47,7 @@ describe('data tag', () => {
5247
it('should throw if the data tag is used with something unrecognized', async () => {
5348
const page = await Page.init({
5449
relativePath: 'liquid-tags/bad-data-variable.md',
55-
basePath: path.join(__dirname, '../../fixtures'),
50+
basePath: './tests/fixtures',
5651
languageCode: 'en',
5752
})
5853
const context = {

0 commit comments

Comments
 (0)