Skip to content

Commit

Permalink
CI
Browse files Browse the repository at this point in the history
  • Loading branch information
75lb committed Nov 1, 2024
1 parent 9185262 commit 0d1637c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ jobs:

strategy:
matrix:
os: [ubuntu-latest, windows-latest] # Remove windows as tests fail on `\r\n` style newlines
node-version: [12, 14, 16, 18, 20, 22, 23]
# os: [ubuntu-latest, windows-latest]
# node-version: [12, 14, 16, 18, 20, 22, 23]
os: [windows-latest]
node-version: [22]

steps:
- uses: actions/checkout@v4
Expand Down
25 changes: 14 additions & 11 deletions test/caching.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,25 @@ import path from 'path'
/* tests need to run with a maxConcurrency of 1 as `jsdoc.cache` is shared between tests */
const [test, only, skip] = [new Map(), new Map(), new Map()]

test.set('.explain({ files, cache: true })', async function () {
only.set('.explain({ files, cache: true })', async function () {
const f = new Fixture('class-all')
jsdoc.cache.dir = 'tmp/test/cache1'
await jsdoc.cache.clear()
let output = await jsdoc.explain({ files: f.sourcePath, cache: true })
console.log('======BEFORE')
console.log(output)
output = Fixture.normaliseNewLines(output)
const cachedFiles = readdirSync(jsdoc.cache.dir)
.map(file => path.resolve(jsdoc.cache.dir, file))
a.equal(cachedFiles.length, 1)
a.deepEqual(output, f.getExpectedOutput(output))
const cachedData = JSON.parse(readFileSync(cachedFiles[0], 'utf8'))
Fixture.removeFileSpecificData(cachedData)
a.deepEqual(
cachedData,
f.getExpectedOutput(output)
)
console.log('======AFTER')
console.log(output)
// const cachedFiles = readdirSync(jsdoc.cache.dir).map(file => path.resolve(jsdoc.cache.dir, file))
// a.equal(cachedFiles.length, 1)
// a.deepEqual(output, f.getExpectedOutput(output))
// const cachedData = JSON.parse(readFileSync(cachedFiles[0], 'utf8'))
// Fixture.removeFileSpecificData(cachedData)
// a.deepEqual(
// cachedData,
// f.getExpectedOutput(output)
// )
})

test.set('.explain({ source, cache: true }) - Ensure correct output (#147)', async function () {
Expand Down

0 comments on commit 0d1637c

Please sign in to comment.