Skip to content

Commit

Permalink
Ensure tests run across different filesystems
Browse files Browse the repository at this point in the history
  • Loading branch information
garthenweb committed Feb 17, 2019
1 parent e3be9aa commit 997153f
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions packages/core/integration-tests/test/css.js
Expand Up @@ -337,8 +337,10 @@ describe('css', function() {
assert.equal(typeof output, 'function');

let value = output();
assert.equal(value.composes1, '_composes1_29315 _test_19e21');
assert.equal(value.composes2, '_composes2_b5878 _test_19e21');
assert(value.composes1.split(' ')[0].startsWith('_composes1_'));
assert(value.composes1.split(' ')[1].startsWith('_test_'));
assert(value.composes2.split(' ')[0].startsWith('_composes2_'));
assert(value.composes2.split(' ')[1].startsWith('_test_'));

let css = await fs.readFile(
path.join(__dirname, '/dist/index.css'),
Expand Down Expand Up @@ -391,7 +393,8 @@ describe('css', function() {
assert.equal(typeof output, 'function');

let value = output();
assert.equal(value.composes3, '_composes3_6834d _test_c0a12');
assert(value.composes3.split(' ')[0].startsWith('_composes3_'));
assert(value.composes3.split(' ')[1].startsWith('_test_'));

let css = await fs.readFile(
path.join(__dirname, '/dist/index2.css'),
Expand Down Expand Up @@ -424,7 +427,8 @@ describe('css', function() {
assert.equal(typeof output, 'function');

let value = output();
assert.equal(value.composes4, '_composes4_7038c _test_19e21');
assert(value.composes4.split(' ')[0].startsWith('_composes4_'));
assert(value.composes4.split(' ')[1].startsWith('_test_'));

let css = await fs.readFile(
path.join(__dirname, '/dist/index3.css'),
Expand Down Expand Up @@ -462,18 +466,17 @@ describe('css', function() {
assert.equal(typeof output, 'function');

let value = output();
assert.equal(
value.composes5,
'_composes5_c6088 _intermediate_6b681 _test_19e21'
);
assert(value.composes5.split(' ')[0].startsWith('_composes5_'));
assert(value.composes5.split(' ')[1].startsWith('_intermediate_'));
assert(value.composes5.split(' ')[2].startsWith('_test_'));

let css = await fs.readFile(
path.join(__dirname, '/dist/index4.css'),
'utf8'
);
assert(css.includes('height: 100px;'));
assert(css.includes('height: 300px;'));
assert(css.indexOf('_test_19e21') < css.indexOf('_intermediate_6b681'));
assert(css.indexOf('._test_') < css.indexOf('._intermediate_'));
});

it('should support postcss composes imports for multiple selectors', async function() {
Expand All @@ -500,7 +503,9 @@ describe('css', function() {
assert.equal(typeof output, 'function');

let value = output();
assert.equal(value.composes6, '_composes6_d20ad _test_19e21 _test-2_19e21');
assert(value.composes6.split(' ')[0].startsWith('_composes6_'));
assert(value.composes6.split(' ')[1].startsWith('_test_'));
assert(value.composes6.split(' ')[2].startsWith('_test-2_'));
});

it('should minify CSS in production mode', async function() {
Expand Down

0 comments on commit 997153f

Please sign in to comment.