Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Oct 28, 2021
1 parent 11f6fe8 commit 56c7f28
Show file tree
Hide file tree
Showing 14 changed files with 1,338 additions and 2,888 deletions.
42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,38 +32,38 @@
"postcss": "^8.1.0"
},
"dependencies": {
"browserslist": "^4.17.4",
"caniuse-lite": "^1.0.30001270",
"browserslist": "^4.17.5",
"caniuse-lite": "^1.0.30001272",
"fraction.js": "^4.1.1",
"normalize-range": "^0.1.2",
"picocolors": "^1.0.0",
"postcss-value-parser": "^4.1.0"
},
"devDependencies": {
"@logux/eslint-config": "^45.4.8",
"@size-limit/preset-small-lib": "5.0.5",
"@logux/eslint-config": "^46.0.1",
"@size-limit/preset-small-lib": "6.0.3",
"@types/jest": "^27.0.2",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"check-dts": "^0.5.6",
"clean-publish": "^3.0.3",
"eslint": "^7.32.0",
"@typescript-eslint/eslint-plugin": "^5.2.0",
"@typescript-eslint/parser": "^5.2.0",
"check-dts": "^0.6.2",
"clean-publish": "^3.4.2",
"eslint": "^8.1.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-jest": "^24.5.2",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jest": "^25.2.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prefer-let": "^1.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-prefer-let": "^3.0.0",
"eslint-plugin-promise": "^5.1.1",
"eslint-plugin-security": "^1.4.0",
"eslint-plugin-unicorn": "^36.0.0",
"jest": "^27.2.4",
"lint-staged": "^11.2.0",
"postcss": "^8.3.9",
"eslint-plugin-unicorn": "^37.0.1",
"jest": "^27.3.1",
"lint-staged": "^11.2.6",
"postcss": "^8.3.11",
"prettier": "^2.4.1",
"simple-git-hooks": "^2.6.1",
"size-limit": "^5.0.5",
"ts-jest": "^27.0.5",
"typescript": "^4.4.3"
"simple-git-hooks": "^2.7.0",
"size-limit": "^6.0.3",
"ts-jest": "^27.0.7",
"typescript": "^4.4.4"
},
"lint-staged": {
"*.js": [
Expand Down
8 changes: 3 additions & 5 deletions test/autoprefixer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ it('takes values from other PostCSS plugins', () => {
})
}
let result = postcss([plugin, compiler]).process('a{width:0/**/0}')
expect(result.css).toEqual('a{width:-webkit-calc(0);width:calc(0)}')
expect(result.css).toBe('a{width:-webkit-calc(0);width:calc(0)}')
})

it('has option to disable @supports support', () => {
Expand Down Expand Up @@ -773,9 +773,7 @@ describe('hacks', () => {
it('supports appearance for IE', () => {
let instance = autoprefixer({ overrideBrowserslist: 'Edge 15' })
let result = postcss([instance]).process('a { appearance: none }')
expect(result.css).toEqual(
'a { -webkit-appearance: none; appearance: none }'
)
expect(result.css).toBe('a { -webkit-appearance: none; appearance: none }')
})

it('changes angle in gradient', () => {
Expand All @@ -801,7 +799,7 @@ describe('hacks', () => {

it('warns on old flexbox display', () => {
let result = postcss([flexboxer]).process('a{ display: box; }')
expect(result.css).toEqual('a{ display: box; }')
expect(result.css).toBe('a{ display: box; }')
expect(result.warnings().map(i => i.toString())).toEqual([
'autoprefixer: <css input>:1:4: You should write display: flex ' +
'by final spec instead of display: box'
Expand Down
6 changes: 3 additions & 3 deletions test/brackets.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ describe('.parse()', () => {

describe('.stringify()', () => {
it('stringifies simple string', () => {
expect(brackets.stringify(['test'])).toEqual('test')
expect(brackets.stringify(['test'])).toBe('test')
})

it('stringifies brackets', () => {
expect(brackets.stringify(['a ', ['b'], ' a'])).toEqual('a (b) a')
expect(brackets.stringify(['a ', ['b'], ' a'])).toBe('a (b) a')
})

it('stringifies many brackets', () => {
expect(brackets.stringify(['a ', ['b ', [''], ''], ' a'])).toEqual(
expect(brackets.stringify(['a ', ['b ', [''], ''], ' a'])).toBe(
'a (b ()) a'
)
})
Expand Down
10 changes: 5 additions & 5 deletions test/browsers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ describe('parse()', () => {
describe('prefix()', () => {
it('returns browser prefix', () => {
let browsers = new Browsers(data, ['chrome 30'])
expect(browsers.prefix('chrome 30')).toEqual('-webkit-')
expect(browsers.prefix('chrome 30')).toBe('-webkit-')
})

it('returns right prefix for Operas', () => {
let browsers = new Browsers(data, ['last 1 opera version'])
expect(browsers.prefix('opera 12')).toEqual('-o-')
expect(browsers.prefix(browsers.selected[0])).toEqual('-webkit-')
expect(browsers.prefix('op_mob 12')).toEqual('-o-')
expect(browsers.prefix(browsers.selected[0])).toEqual('-webkit-')
expect(browsers.prefix('opera 12')).toBe('-o-')
expect(browsers.prefix(browsers.selected[0])).toBe('-webkit-')
expect(browsers.prefix('op_mob 12')).toBe('-o-')
expect(browsers.prefix(browsers.selected[0])).toBe('-webkit-')
})
})

Expand Down
16 changes: 8 additions & 8 deletions test/declaration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ describe('maxPrefixed()', () => {
it('returns max prefix length', () => {
let decl = parse('a { tab-size: 4 }').first.first
let list = ['-webkit-', '-webkit- old', '-moz-']
expect(tabsize.maxPrefixed(list, decl)).toEqual(8)
expect(tabsize.maxPrefixed(list, decl)).toBe(8)
})
})

describe('calcBefore()', () => {
it('returns before with cascade', () => {
let decl = parse('a { tab-size: 4 }').first.first
let list = ['-webkit-', '-moz- old', '-moz-']
expect(tabsize.calcBefore(list, decl, '-moz- old')).toEqual(' ')
expect(tabsize.calcBefore(list, decl, '-moz- old')).toBe(' ')
})
})

Expand All @@ -62,45 +62,45 @@ describe('restoreBefore()', () => {
let css = parse('a {\n' + ' -moz-tab-size: 4;\n' + ' tab-size: 4 }')
let decl = css.first.nodes[1]
tabsize.restoreBefore(decl)
expect(decl.raws.before).toEqual('\n ')
expect(decl.raws.before).toBe('\n ')
})
})

describe('prefixed()', () => {
it('returns prefixed property', () => {
let css = parse('a { tab-size: 2 }')
let decl = css.first.first
expect(tabsize.prefixed(decl.prop, '-moz-')).toEqual('-moz-tab-size')
expect(tabsize.prefixed(decl.prop, '-moz-')).toBe('-moz-tab-size')
})
})

describe('normalize()', () => {
it('returns property name by specification', () => {
expect(tabsize.normalize('tab-size')).toEqual('tab-size')
expect(tabsize.normalize('tab-size')).toBe('tab-size')
})
})

describe('process()', () => {
it('adds prefixes', () => {
let css = parse('a { -moz-tab-size: 2; tab-size: 2 }')
tabsize.process(css.first.nodes[1])
expect(css.toString()).toEqual(
expect(css.toString()).toBe(
'a { -moz-tab-size: 2; -ms-tab-size: 2; tab-size: 2 }'
)
})

it('checks parents prefix', () => {
let css = parse('::-moz-selection a { tab-size: 2 }')
tabsize.process(css.first.first)
expect(css.toString()).toEqual(
expect(css.toString()).toBe(
'::-moz-selection a { -moz-tab-size: 2; tab-size: 2 }'
)
})

it('checks value for prefixes', () => {
let css = parse('a { tab-size: -ms-calc(2) }')
tabsize.process(css.first.first)
expect(css.toString()).toEqual(
expect(css.toString()).toBe(
'a { -ms-tab-size: -ms-calc(2); tab-size: -ms-calc(2) }'
)
})
Expand Down
2 changes: 1 addition & 1 deletion test/info.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,5 @@ it('returns string for empty prefixes', () => {
it('returns string for empty browsers', () => {
let browsers = new Browsers(data.browsers, [])
let prefixes = new Prefixes(data.prefixes, browsers)
expect(info(prefixes)).toEqual('No browsers selected')
expect(info(prefixes)).toBe('No browsers selected')
})
4 changes: 1 addition & 3 deletions test/postcss.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,5 @@ it('works with other PostCSS plugins', () => {
from: 'a.css'
})

expect(result.css).toEqual(
'b{ -webkit-user-select: none; user-select: none; }'
)
expect(result.css).toBe('b{ -webkit-user-select: none; user-select: none; }')
})
22 changes: 11 additions & 11 deletions test/prefixer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('.hack()', () => {
A.hack(Hack)

expect(A.hacks).toEqual({ a: Hack, b: Hack })
expect(Prefixer.hacks).not.toBeDefined()
expect(Prefixer.hacks).toBeUndefined()
})
})

Expand All @@ -41,8 +41,8 @@ describe('.load()', () => {
}
A.hacks = { hacked: Hack }

expect(A.load('hacked').klass).toEqual('hack')
expect(A.load('a').klass).toEqual('a')
expect(A.load('hacked').klass).toBe('hack')
expect(A.load('a').klass).toBe('a')
})
})

Expand All @@ -53,16 +53,16 @@ describe('.clone()', () => {
rule._autoprefixerValues = { '-ms-': 1 }

let cloned = Prefixer.clone(rule, { selector: 'from' })
expect(cloned.selector).toEqual('from')
expect(cloned.selector).toBe('from')

expect(cloned._autoprefixerPrefix).not.toBeDefined()
expect(cloned._autoprefixerValues).not.toBeDefined()
expect(cloned._autoprefixerPrefix).toBeUndefined()
expect(cloned._autoprefixerValues).toBeUndefined()
})

it('fixed declaration between', () => {
let parsed = parse('a { color : black }')
let cloned = Prefixer.clone(parsed.first.first)
expect(cloned.raws.between).toEqual(' : ')
expect(cloned.raws.between).toBe(' : ')
})
})

Expand All @@ -72,22 +72,22 @@ describe('parentPrefix', () => {
})

it('finds in at-rules', () => {
expect(prefix.parentPrefix(css.first)).toEqual('-ms-')
expect(prefix.parentPrefix(css.first)).toBe('-ms-')
})

it('finds in selectors', () => {
expect(prefix.parentPrefix(css.nodes[1])).toEqual('-moz-')
expect(prefix.parentPrefix(css.nodes[1])).toBe('-moz-')
})

it('finds in parents', () => {
let decl = css.first.first
expect(prefix.parentPrefix(decl)).toEqual('-ms-')
expect(prefix.parentPrefix(decl)).toBe('-ms-')
expect(prefix.parentPrefix(css.nodes[2])).toBe(false)
})

it('caches prefix', () => {
prefix.parentPrefix(css.first)
expect(css.first._autoprefixerPrefix).toEqual('-ms-')
expect(css.first._autoprefixerPrefix).toBe('-ms-')

css.first._autoprefixerPrefix = false
expect(prefix.parentPrefix(css.first)).toBe(false)
Expand Down
6 changes: 3 additions & 3 deletions test/prefixes.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,17 @@ describe('.decl()', () => {

describe('.unprefixed()', () => {
it('returns unprefixed version', () => {
expect(empty.unprefixed('-moz-a')).toEqual('a')
expect(empty.unprefixed('-moz-a')).toBe('a')
})
})

describe('.prefixed()', () => {
it('adds prefix', () => {
expect(empty.prefixed('a', '-ms-')).toEqual('-ms-a')
expect(empty.prefixed('a', '-ms-')).toBe('-ms-a')
})

it('changes prefix', () => {
expect(empty.prefixed('a', '-ms-')).toEqual('-ms-a')
expect(empty.prefixed('a', '-ms-')).toBe('-ms-a')
})
})

Expand Down
12 changes: 6 additions & 6 deletions test/selector.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ beforeEach(() => {

describe('prefixed()', () => {
it('adds prefix after non-letters symbols', () => {
expect(selector.prefixed('-moz-')).toEqual('::-moz-selection')
expect(selector.prefixed('-moz-')).toBe('::-moz-selection')
})
})

Expand Down Expand Up @@ -107,23 +107,23 @@ describe('replace()', () => {
it('adds prefix to selectors', () => {
expect(
selector.replace('body ::selection, input::selection, a', '-ms-')
).toEqual('body ::-ms-selection, input::-ms-selection, a')
).toBe('body ::-ms-selection, input::-ms-selection, a')
})
})

describe('process()', () => {
it('adds prefixes', () => {
let css = parse('b ::-moz-selection{} b ::selection{}')
selector.process(css.nodes[1])
expect(css.toString()).toEqual(
expect(css.toString()).toBe(
'b ::-moz-selection{} b ::-ms-selection{} b ::selection{}'
)
})

it('checks parents prefix', () => {
let css = parse('@-moz-page{ ::selection{} }')
selector.process(css.first.first)
expect(css.toString()).toEqual(
expect(css.toString()).toBe(
'@-moz-page{ ::-moz-selection{} ::selection{} }'
)
})
Expand All @@ -132,7 +132,7 @@ describe('process()', () => {
describe('old()', () => {
it('returns object to find old selector', () => {
let old = selector.old('-moz-')
expect(old.unprefixed).toEqual('::selection')
expect(old.prefix).toEqual('-moz-')
expect(old.unprefixed).toBe('::selection')
expect(old.prefix).toBe('-moz-')
})
})
Loading

0 comments on commit 56c7f28

Please sign in to comment.