Skip to content

Commit

Permalink
Add normalize-newline package
Browse files Browse the repository at this point in the history
  • Loading branch information
1aron committed Jan 22, 2024
1 parent 84529f5 commit 1e63fb0
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"jest-text-transformer": "^1.0.4",
"nanoid": "^4.0.2",
"nodemon": "^2.0.22",
"normalize-newline": "^4.1.0",
"pretty-ms": "^8.0.0",
"shuffle-array": "^1.0.1",
"spawnd": "^9.0.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/css/tests/cjs/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import { execSync } from 'child_process'
import { resolve } from 'path'
import { readFileSync } from 'fs'
import { rm } from 'css-shared/utils/fs'
import normalizeNewline from 'normalize-newline'

it('init cjs', () => {
const configFilepath = resolve(__dirname, 'master.css.js')
rm(configFilepath)
execSync('tsx ../../dist/bin/index.bundle.js init', { cwd: __dirname, stdio: 'inherit' })
expect(readFileSync(configFilepath, 'utf-8').normalize()).toEqual(require('../../src/master.css.js.txt').normalize())
expect(normalizeNewline(readFileSync(configFilepath, 'utf-8'))).toEqual(normalizeNewline(require('../../src/master.css.js.txt')))
rm(configFilepath)
})
3 changes: 2 additions & 1 deletion packages/css/tests/esm/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import { execSync } from 'child_process'
import { resolve } from 'path'
import { readFileSync } from 'fs'
import { rm } from 'css-shared/utils/fs'
import normalizeNewline from 'normalize-newline'

it('init (type="module")', () => {
const configFilepath = resolve(__dirname, 'master.css.mjs')
rm(configFilepath)
execSync('tsx ../../dist/bin/index.bundle.js init', { cwd: __dirname, stdio: 'inherit' })
expect(readFileSync(configFilepath, 'utf-8').normalize()).toEqual(require('../../src/master.css.mjs.txt').normalize())
expect(normalizeNewline(readFileSync(configFilepath, 'utf-8'))).toEqual(normalizeNewline(require('../../src/master.css.mjs.txt')))
rm(configFilepath)
})
3 changes: 2 additions & 1 deletion packages/css/tests/ts/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import { execSync } from 'child_process'
import { readFileSync } from 'fs'
import { resolve } from 'path'
import { rm } from 'css-shared/utils/fs'
import normalizeNewline from 'normalize-newline'

it('init by tsconfig.json', () => {
const configFilepath = resolve(__dirname, 'master.css.ts')
rm(configFilepath)
execSync('tsx ../../dist/bin/index.bundle.js init', { cwd: __dirname, stdio: 'inherit' })
expect(readFileSync(configFilepath, 'utf-8').normalize()).toEqual(require('../../src/master.css.ts.txt').normalize())
expect(normalizeNewline(readFileSync(configFilepath, 'utf-8'))).toEqual(normalizeNewline(require('../../src/master.css.ts.txt')))
rm(configFilepath)
})
15 changes: 15 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1e63fb0

Please sign in to comment.