1
0
mirror of synced 2025-12-21 10:57:10 -05:00
Files
docs/tests/content/gitignore.js
Kevin Heis 0b1ff73a46 Update some readFileSync to await readFile with top level await (#20525)
* 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>
2021-07-29 16:45:46 +00:00

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)
})
})