* Update some readFileSync to await readFile with top level await * More updates * Update all-products.js * Use 'lib/readfile-async.js' in runtime files for better performance * Remove unnecessary use of 'for await...of' loops * Revert to importing 'fs/promises' Co-authored-by: James M. Greene <jamesmgreene@github.com>
12 lines
369 B
JavaScript
12 lines
369 B
JavaScript
import fs from 'fs/promises'
|
|
import path from 'path'
|
|
const gitignorePath = path.join(process.cwd(), '.gitignore')
|
|
const gitignore = await fs.readFile(gitignorePath, 'utf8')
|
|
const entries = gitignore.split(/\r?\n/)
|
|
|
|
describe('.gitignore file', () => {
|
|
test('includes an entry for .env', () => {
|
|
expect(entries.some((entry) => entry === '.env')).toBe(true)
|
|
})
|
|
})
|