Skip to content

Commit

Permalink
fix: run lint:fix on templates package
Browse files Browse the repository at this point in the history
Signed-off-by: Tierney Cyren <[email protected]>
  • Loading branch information
bnb committed Mar 28, 2024
1 parent ac0e98c commit 85caef7
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion templates/dir.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = __dirname
module.exports = __dirname
2 changes: 1 addition & 1 deletion templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"lint": "standard",
"lint:fix": "standard --fix",
"test": "node --test",
"coverage": "nyc mocha",
"coverage": "nyc node --test",
"examples": "npm run examples:default && npm run examples:usingCore",
"examples:output": "npm run examples:default:output && npm run examples:usingCore:output",
"examples:default": "node examples/default.js",
Expand Down
2 changes: 1 addition & 1 deletion templates/templates/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async function generateBasicRetro (data, options = {}) {
const repos = await generateRepoInformationFromData(data)

const body = await generateBody(repos)

const output = await generateDoc(usableOptions.heading, usableOptions.preface, body)
return output
}
Expand Down
4 changes: 2 additions & 2 deletions templates/test/generateBody.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const test = require('node:test')
const { deepStrictEqual } = require('node:assert')
const { readFile, writeFile, unlink } = require('node:fs/promises')
const { resolve } = require('node:path');
const { resolve } = require('node:path')
const core = require('@retrogen/core')
const dir = require('../dir')
const generateRepoInformationFromData = require('../tools/generateRepoInformationFromData')
Expand All @@ -25,4 +25,4 @@ test('working with the core module directly should not error', async (context) =
// delete the assertion file we just wrote
await unlink(assertionPath)
})
})
})
4 changes: 2 additions & 2 deletions templates/test/generateRepoInformationFromData.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ test('working with the core module directly should not error', async (context) =

await context.test('ensure all entries have open, merged, and closed', async (context) => {
const nodejsComposedData = await generateRepoInformationFromData(nodejsData)
for(const entry in nodejsComposedData) {
for (const entry in nodejsComposedData) {
deepStrictEqual(Object.hasOwn(nodejsComposedData[entry], 'open'), true)
deepStrictEqual(Object.hasOwn(nodejsComposedData[entry], 'merged'), true)
deepStrictEqual(Object.hasOwn(nodejsComposedData[entry], 'closed'), true)
}
})
})
})
6 changes: 3 additions & 3 deletions templates/testUtils/generateBody.setup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { writeFile } = require('node:fs/promises')
const { resolve } = require('node:path');
const { resolve } = require('node:path')
const core = require('@retrogen/core')
const generateRepoInformationFromData = require('../tools/generateRepoInformationFromData')
const generateBody = require('../tools/generateBody')
Expand All @@ -11,8 +11,8 @@ async function setup () {
const composedData = await generateRepoInformationFromData(data)
const referencePath = resolve(`${dir}/testUtils/reference/body.md`)
const body = await generateBody(composedData)

await writeFile(referencePath, body)
}

setup ()
setup()
12 changes: 5 additions & 7 deletions templates/testUtils/generateRepoInformationFromData.setup.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
const { writeFile } = require('node:fs/promises')
const { resolve } = require('node:path');
const { resolve } = require('node:path')
const core = require('@retrogen/core')
const generateRepoInformationFromData = require('../tools/generateRepoInformationFromData')
const generateBody = require('../tools/generateBody')
const dir = require('../dir')
const dates = require('./dates.json')


async function setup() {
async function setup () {
// configuration variables that we use later
const nodejsReferencePath = resolve(`${dir}/testUtils/reference/generateRepoInformationFromData.nodejs.json`)
const twilioReferencePath = resolve(`${dir}/testUtils/reference/generateRepoInformationFromData.twilio.json`)

// get data and compose it
const nodejsData = await core('nodejs', dates)
const twilioData = await core('twilio', dates)
const nodejsComposedData = await generateRepoInformationFromData(nodejsData)
const twilioComposedData = await generateRepoInformationFromData(twilioData)

// write the composed data to its final location
await writeFile(nodejsReferencePath, JSON.stringify(nodejsComposedData, null, 2))
await writeFile(twilioReferencePath, JSON.stringify(twilioComposedData, null, 2))
}

setup()
setup()

0 comments on commit 85caef7

Please sign in to comment.