diff options
Diffstat (limited to 'node_modules/rucksack-css/test')
23 files changed, 0 insertions, 343 deletions
diff --git a/node_modules/rucksack-css/test/fixtures/alias.css b/node_modules/rucksack-css/test/fixtures/alias.css deleted file mode 100644 index ad4c00ad..00000000 --- a/node_modules/rucksack-css/test/fixtures/alias.css +++ /dev/null @@ -1,11 +0,0 @@ -@alias { - fs: font-size; - fw: font-weight; - bg: background; -} - -.foo { - fs: 16px; - fw: 400; - bg: #fff; -}
\ No newline at end of file diff --git a/node_modules/rucksack-css/test/fixtures/alias.expected.css b/node_modules/rucksack-css/test/fixtures/alias.expected.css deleted file mode 100644 index 27d718de..00000000 --- a/node_modules/rucksack-css/test/fixtures/alias.expected.css +++ /dev/null @@ -1,5 +0,0 @@ -.foo { - font-size: 16px; - font-weight: 400; - background: #fff; -}
\ No newline at end of file diff --git a/node_modules/rucksack-css/test/fixtures/autoprefixer.css b/node_modules/rucksack-css/test/fixtures/autoprefixer.css deleted file mode 100644 index ea300bc8..00000000 --- a/node_modules/rucksack-css/test/fixtures/autoprefixer.css +++ /dev/null @@ -1,3 +0,0 @@ -.foo { - display: flex -} diff --git a/node_modules/rucksack-css/test/fixtures/autoprefixer.expected.css b/node_modules/rucksack-css/test/fixtures/autoprefixer.expected.css deleted file mode 100644 index a54f36c3..00000000 --- a/node_modules/rucksack-css/test/fixtures/autoprefixer.expected.css +++ /dev/null @@ -1,5 +0,0 @@ -.foo { - display: -webkit-box; - display: -ms-flexbox; - display: flex -} diff --git a/node_modules/rucksack-css/test/fixtures/clearfix.css b/node_modules/rucksack-css/test/fixtures/clearfix.css deleted file mode 100644 index 4775fc7b..00000000 --- a/node_modules/rucksack-css/test/fixtures/clearfix.css +++ /dev/null @@ -1,3 +0,0 @@ -.foo { - clear: fix; -} diff --git a/node_modules/rucksack-css/test/fixtures/clearfix.expected.css b/node_modules/rucksack-css/test/fixtures/clearfix.expected.css deleted file mode 100644 index 0c7831be..00000000 --- a/node_modules/rucksack-css/test/fixtures/clearfix.expected.css +++ /dev/null @@ -1,5 +0,0 @@ -.foo:after { - content: ''; - display: block; - clear: both; -} diff --git a/node_modules/rucksack-css/test/fixtures/easings.css b/node_modules/rucksack-css/test/fixtures/easings.css deleted file mode 100644 index e9a2c1f0..00000000 --- a/node_modules/rucksack-css/test/fixtures/easings.css +++ /dev/null @@ -1,11 +0,0 @@ -.foo { - transition: all 1s easeInSine; -} - -.bar { - transition: all 1s ease-in-sine; -} - -.baz { - transition: ease-in-sine, easeInOutExpo; -}
\ No newline at end of file diff --git a/node_modules/rucksack-css/test/fixtures/easings.expected.css b/node_modules/rucksack-css/test/fixtures/easings.expected.css deleted file mode 100644 index ca68f6dd..00000000 --- a/node_modules/rucksack-css/test/fixtures/easings.expected.css +++ /dev/null @@ -1,11 +0,0 @@ -.foo { - transition: all 1s cubic-bezier(0.47, 0, 0.745, 0.715); -} - -.bar { - transition: all 1s cubic-bezier(0.47, 0, 0.745, 0.715); -} - -.baz { - transition: cubic-bezier(0.47, 0, 0.745, 0.715), cubic-bezier(1, 0, 0, 1); -}
\ No newline at end of file diff --git a/node_modules/rucksack-css/test/fixtures/fontpath.css b/node_modules/rucksack-css/test/fixtures/fontpath.css deleted file mode 100644 index c8c8b6f5..00000000 --- a/node_modules/rucksack-css/test/fixtures/fontpath.css +++ /dev/null @@ -1,6 +0,0 @@ -@font-face { - font-family: 'Test'; - font-path: '/path/to/font'; - font-weight: normal; - font-style: normal; -}
\ No newline at end of file diff --git a/node_modules/rucksack-css/test/fixtures/fontpath.expected.css b/node_modules/rucksack-css/test/fixtures/fontpath.expected.css deleted file mode 100644 index e6da7d95..00000000 --- a/node_modules/rucksack-css/test/fixtures/fontpath.expected.css +++ /dev/null @@ -1,10 +0,0 @@ -@font-face { - font-family: 'Test'; - src: url("/path/to/font.eot") format('embedded-opentype'), - url("/path/to/font.woff2") format('woff2'), - url("/path/to/font.woff") format('woff'), - url("/path/to/font.ttf") format('truetype'), - url("/path/to/font.svg") format('svg'); - font-weight: normal; - font-style: normal; -}
\ No newline at end of file diff --git a/node_modules/rucksack-css/test/fixtures/hexrgba.css b/node_modules/rucksack-css/test/fixtures/hexrgba.css deleted file mode 100644 index 34f820b3..00000000 --- a/node_modules/rucksack-css/test/fixtures/hexrgba.css +++ /dev/null @@ -1,4 +0,0 @@ -.foo { - color: rgba(#ffffff, 0.5); - background: rgba(#00b2ff,.8); -} diff --git a/node_modules/rucksack-css/test/fixtures/hexrgba.expected.css b/node_modules/rucksack-css/test/fixtures/hexrgba.expected.css deleted file mode 100644 index 9dfe2dfb..00000000 --- a/node_modules/rucksack-css/test/fixtures/hexrgba.expected.css +++ /dev/null @@ -1,4 +0,0 @@ -.foo { - color: rgba(255,255,255, 0.5); - background: rgba(0,178,255,.8); -} diff --git a/node_modules/rucksack-css/test/fixtures/input.css b/node_modules/rucksack-css/test/fixtures/input.css deleted file mode 100644 index 843bdb54..00000000 --- a/node_modules/rucksack-css/test/fixtures/input.css +++ /dev/null @@ -1,6 +0,0 @@ -input[type="range"]::thumb { - background: #4286be; - width: 16px; - height: 8px; - border-radius: 999px; -} diff --git a/node_modules/rucksack-css/test/fixtures/input.expected.css b/node_modules/rucksack-css/test/fixtures/input.expected.css deleted file mode 100644 index 10a37efb..00000000 --- a/node_modules/rucksack-css/test/fixtures/input.expected.css +++ /dev/null @@ -1,26 +0,0 @@ -input[type="range"]::-webkit-slider-thumb { - -webkit-appearance: none; - background: #4286be; - width: 16px; - height: 8px; - border-radius: 999px; -} -input[type="range"]::-moz-range-thumb { - -moz-appearance: none; - background: #4286be; - width: 16px; - height: 8px; - border-radius: 999px; -} -input[type="range"]::-ms-thumb { - background: #4286be; - width: 16px; - height: 8px; - border-radius: 999px; -} -input[type="range"] { - -webkit-appearance: none; -} -input[type="range"]::-moz-focus-outer { - border: 0; -} diff --git a/node_modules/rucksack-css/test/fixtures/laggard.css b/node_modules/rucksack-css/test/fixtures/laggard.css deleted file mode 100644 index eba6d645..00000000 --- a/node_modules/rucksack-css/test/fixtures/laggard.css +++ /dev/null @@ -1,24 +0,0 @@ -.opacity { - opacity: .5; -} - -.pseudo::after { - display: block; -} - -.rgba { - background: rgba(153, 221, 153, 0.8); - color: rgba(0, 0, 0, .4); -} - -.vmin { - width: 50vmin; -} - -.pixrem { - font-size: 2rem; -} - -.willchange { - will-change: transform; -} diff --git a/node_modules/rucksack-css/test/fixtures/laggard.expected.css b/node_modules/rucksack-css/test/fixtures/laggard.expected.css deleted file mode 100644 index 2cee4f69..00000000 --- a/node_modules/rucksack-css/test/fixtures/laggard.expected.css +++ /dev/null @@ -1,30 +0,0 @@ -.opacity { - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; - opacity: .5; -} - -.pseudo:after { - display: block; -} - -.rgba { - background: #99dd99; - background: rgba(153, 221, 153, 0.8); - color: #000000; - color: rgba(0, 0, 0, .4); -} - -.vmin { - width: 50vm; - width: 50vmin; -} - -.pixrem { - font-size: 32px; - font-size: 2rem; -} - -.willchange { - backface-visibility: hidden; - will-change: transform; -} diff --git a/node_modules/rucksack-css/test/fixtures/position.css b/node_modules/rucksack-css/test/fixtures/position.css deleted file mode 100644 index a50818d5..00000000 --- a/node_modules/rucksack-css/test/fixtures/position.css +++ /dev/null @@ -1,15 +0,0 @@ -.foo { - position: absolute 10px 20px 30px 40px; -} - -.bar { - position: fixed 0; -} - -.baz { - position: absolute 30px auto; -} - -.fab { - position: relative 50% 0 20px; -} diff --git a/node_modules/rucksack-css/test/fixtures/position.expected.css b/node_modules/rucksack-css/test/fixtures/position.expected.css deleted file mode 100644 index 5f688f32..00000000 --- a/node_modules/rucksack-css/test/fixtures/position.expected.css +++ /dev/null @@ -1,31 +0,0 @@ -.foo { - position: absolute; - top: 10px; - right: 20px; - bottom: 30px; - left: 40px; -} - -.bar { - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; -} - -.baz { - position: absolute; - top: 30px; - right: auto; - bottom: 30px; - left: auto; -} - -.fab { - position: relative; - top: 50%; - right: 0; - bottom: 20px; - left: 0; -} diff --git a/node_modules/rucksack-css/test/fixtures/quantity.css b/node_modules/rucksack-css/test/fixtures/quantity.css deleted file mode 100644 index 66896484..00000000 --- a/node_modules/rucksack-css/test/fixtures/quantity.css +++ /dev/null @@ -1,15 +0,0 @@ -.foo > li:at-least(4) { - content: 'test'; -} - -.bar > li:at-most(4) { - content: 'test'; -} - -.baz > li:between(4, 6) { - content: 'test'; -} - -.fab > li:exactly(4) { - content: 'test'; -}
\ No newline at end of file diff --git a/node_modules/rucksack-css/test/fixtures/quantity.expected.css b/node_modules/rucksack-css/test/fixtures/quantity.expected.css deleted file mode 100644 index 74f37a92..00000000 --- a/node_modules/rucksack-css/test/fixtures/quantity.expected.css +++ /dev/null @@ -1,15 +0,0 @@ -.foo > li:nth-last-child(n+4), .foo > li:nth-last-child(n+4) ~ li { - content: 'test'; -} - -.bar > li:nth-last-child(-n+4):first-child, .bar > li:nth-last-child(-n+4):first-child ~ li { - content: 'test'; -} - -.baz > li:nth-last-child(n+4):nth-last-child(-n+6):first-child, .baz > li:nth-last-child(n+4):nth-last-child(-n+6):first-child ~ li { - content: 'test'; -} - -.fab > li:nth-last-child(4):first-child, .fab > li:nth-last-child(4):first-child ~ li { - content: 'test'; -}
\ No newline at end of file diff --git a/node_modules/rucksack-css/test/fixtures/responsive-type.css b/node_modules/rucksack-css/test/fixtures/responsive-type.css deleted file mode 100644 index 7cd02e31..00000000 --- a/node_modules/rucksack-css/test/fixtures/responsive-type.css +++ /dev/null @@ -1,4 +0,0 @@ -.foo { - font-size: responsive 10px 30px; - font-range: 300px 900px; -} diff --git a/node_modules/rucksack-css/test/fixtures/responsive-type.expected.css b/node_modules/rucksack-css/test/fixtures/responsive-type.expected.css deleted file mode 100644 index e4569d02..00000000 --- a/node_modules/rucksack-css/test/fixtures/responsive-type.expected.css +++ /dev/null @@ -1,13 +0,0 @@ -.foo { - font-size: calc(10px + 20 * ((100vw - 300px) / 600)); -} -@media screen and (min-width: 900px) { - .foo { - font-size: 30px; - } -} -@media screen and (max-width: 300px) { - .foo { - font-size: 10px; - } -} diff --git a/node_modules/rucksack-css/test/test.js b/node_modules/rucksack-css/test/test.js deleted file mode 100644 index e9eca0fc..00000000 --- a/node_modules/rucksack-css/test/test.js +++ /dev/null @@ -1,86 +0,0 @@ -/* eslint-disable */ - -'use strict'; - -const postcss = require('postcss'); -const expect = require('chai').expect; -const fs = require('fs'); -const path = require('path'); -const spawn = require('child_process').spawn; -const rucksack = require('../'); - -function test(fixture, opts, done) { - let input = fixture + '.css', - expected = fixture + '.expected.css'; - - input = fs.readFileSync(path.join(__dirname, 'fixtures', input), 'utf8'); - expected = fs.readFileSync(path.join(__dirname, 'fixtures', expected), 'utf8'); - - postcss([ rucksack(opts) ]) - .process(input) - .then(result => { - expect(result.css).to.eql(expected); - expect(result.warnings()).to.be.empty; - done(); - }).catch(error => { - done(error); - }); -}; - -function cli(cmd, callback) { - process.chdir(__dirname); - - let ps, - out = '', - err = ''; - - ps = spawn(process.execPath, [ - path.resolve(__dirname, '../bin/cmd.js') - ].concat(cmd)); - - ps.stdout.on('data', buffer => out += buffer); - ps.stderr.on('data', buffer => err += buffer); - ps.on('exit', function(code) { - callback.call(this, err, out, code); - }); -}; - -function cliTest(fixture, args, done) { - let input = fixture + '.css', - expected = fixture + '.expected.css'; - - input = path.join(__dirname, 'fixtures', input); - expected = path.join(__dirname, 'fixtures', expected); - - cli([input, args], (err, out, code) => { - expect(out).to.eql(fs.readFileSync(expected, 'utf8')); - expect(err).to.be.empty; - expect(code).to.eql(0); - done(); - }); -}; - -describe('Rucksack', () => { - - describe('core features', () => { - it('sets aliases', done => test('alias', {}, done)); - it('applies clear:fix', done => test('clearfix', {}, done)); - it('applies easings', done => test('easings', {}, done)); - it('sets font-path', done => test('fontpath', {}, done)); - it('expands rgba(hex,a)', done => test('hexrgba', {}, done)); - it('expands position shorthands', done => test('position', {}, done)); - it('applies quanity queries', done => test('quantity', {}, done)); - it('does responsive type', done => test('responsive-type', {}, done)); - it('adds new input pseudo-elements', done => test('input', {}, done)); - }); - - describe('addons', () => { - it('applies fallbacks', done => test('laggard', { fallbacks: true }, done)); - it('autoprefixes', done => test('autoprefixer', { autoprefixer: true }, done)); - }) - - describe('cli', () => { - it('processes css on the command line', done => cliTest('position', '', done)); - }); - -}); |
