Skip to content

Commit

Permalink
Update minify test to have string length test
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Kallunki committed Feb 4, 2019
1 parent 68547ca commit b8e48fb
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/cssintojs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('csstocssinjs', () => {
it('Should be converted to an object', () => {
expect(resets).to.be.a('object');
expect(resets2).to.be.a('object');
})
});

it('Should contain selectors', () => {
const keys = Object.keys(resets);
Expand All @@ -37,7 +37,7 @@ describe('csstocssinjs', () => {

expect(keys[3]).to.equal('[type="reset"]::-moz-focus-inner');
expect(keys2[3]).to.equal('[type="reset"]::-moz-focus-inner');
})
});

it('Should contain declarations', () => {
const values = resets['html'];
Expand All @@ -47,22 +47,26 @@ describe('csstocssinjs', () => {
expect(values['lineHeight']).to.equal('1.15');

expect(values2).to.be.a('string');
expect(values2).to.equal('line-height: 1.15; -webkit-text-size-adjust: 100%;');

})
expect(values2).to.equal(
'line-height: 1.15; -webkit-text-size-adjust: 100%;'
);
});

it('Should need selector', () => {
const noSelector = cssToJs(`line-height: 1.15; /* 1 */`);

expect(noSelector).to.equal(undefined);
})
});
});

describe('minifyCss', () => {
const minify = minifyCss(css);

it('Should still be a string', () => {
expect(minify).to.be.a('string');
})
});

});
it('Should be certain length of a string', () => {
expect(minify).to.have.lengthOf(208);
});
});

0 comments on commit b8e48fb

Please sign in to comment.