Skip to content

Commit

Permalink
A few tweaks to make local tests run (github#34241)
Browse files Browse the repository at this point in the history
  • Loading branch information
heiskr authored Jan 27, 2023
1 parent 3c7b72b commit 7bf7aff
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
11 changes: 11 additions & 0 deletions script/i18n/clone-translations.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

rm -rf translations
mkdir translations

for lang in "zh-cn" "es-es" "pt-br" "ru-ru" "ja-jp" "fr-fr" "de-de" "ko-kr"
do
(cd translations && git clone --depth 1 "https://github.com/github/docs-internal.$lang.git" $lang)
done

find . -name '.DS_Store' -type f -delete
2 changes: 1 addition & 1 deletion tests/meta/orphan-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import path from 'path'
describe('check for orphan tests', () => {
test('all tests are in sub-directories', async () => {
// A known list of exceptions that can live outside of directories
const EXCEPTIONS = ['README.md', 'package.json', 'utils.js']
const EXCEPTIONS = ['README.md', 'package.json', 'utils.js', '.DS_Store']
const pathToTests = path.join(process.cwd(), 'tests')

// Get a list of files/directories in `/tests`
Expand Down
1 change: 1 addition & 0 deletions tests/meta/repository-references.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ const ALLOW_DOCS_PATHS = [
'ownership.yaml',
'script/README.md',
'script/toggle-ghae-feature-flags.js',
'script/i18n/clone-translations.sh',
]

// This regexp will capture the last segment of a GitHub repo name.
Expand Down
3 changes: 3 additions & 0 deletions tests/translations/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ import { languageKeys } from '../../lib/languages.js'
import { blockIndex } from '../../middleware/block-robots.js'
import { get, getDOMCached as getDOM } from '../helpers/e2etest.js'
import Page from '../../lib/page.js'
import { jest } from '@jest/globals'

const langs = languageKeys.filter((lang) => lang !== 'en')

describe('frame', () => {
jest.setTimeout(60 * 1000)

test.each(langs)('allows crawling of %s pages', async (lang) => {
expect(blockIndex(`/${lang}/articles/verifying-your-email-address`)).toBe(false)
})
Expand Down

0 comments on commit 7bf7aff

Please sign in to comment.