make lib/rest/index.js callable (#23214)
* Experiment with making the tarball smaller Part of #1248 * try this * stop debugging * delete translations too * delete heavy search indexes too * push and popd * try this hack * delete but leave directory * debug more * faster delete of translations * less loud * async await * async await * no tree * simplify * experimenting more * unfinished * only the large files * change order * brotli with level 6 * cope better with decorated rest json files * tidying * keep images * cleaning * cleaning up * refactored function * try this * better comment * remove console logging * more important changes * make lib/rest/index.js callable Part of #1177 * memoize * remove console logging
This commit is contained in:
@@ -4,7 +4,7 @@ import fs from 'fs/promises'
|
||||
import { difference, isPlainObject } from 'lodash-es'
|
||||
import { getJSON } from '../helpers/supertest.js'
|
||||
import enterpriseServerReleases from '../../lib/enterprise-server-releases.js'
|
||||
import rest from '../../lib/rest/index.js'
|
||||
import getRest from '../../lib/rest/index.js'
|
||||
import { jest } from '@jest/globals'
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
||||
@@ -20,7 +20,7 @@ describe('REST references docs', () => {
|
||||
jest.setTimeout(3 * 60 * 1000)
|
||||
|
||||
test('markdown file exists for every operationId prefix in the api.github.com schema', async () => {
|
||||
const { categories } = rest
|
||||
const { categories } = await getRest()
|
||||
const referenceDir = path.join(__dirname, '../../content/rest/reference')
|
||||
const filenames = (await fs.readdir(referenceDir))
|
||||
.filter(
|
||||
@@ -61,7 +61,7 @@ describe('REST references docs', () => {
|
||||
})
|
||||
|
||||
test('no wrongly detected AppleScript syntax highlighting in schema data', async () => {
|
||||
const { operations } = rest
|
||||
const { operations } = await getRest()
|
||||
expect(JSON.stringify(operations).includes('hljs language-applescript')).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user