Skip to content

Commit b6ce0ec

Browse files
authored
BREAKING: change stylesheets.size from Number to Object (#165)
1 parent 029d4a8 commit b6ce0ec

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

src/analyzer/stylesheets/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = ({
77
properties,
88
values
99
}) => {
10-
const filesize = require('./size.js')(rawCss)
10+
const size = require('./size.js')(rawCss)
1111
const simplicity = require('./simplicity.js')(rules, selectors)
1212
const cohesion = require('./cohesion.js')(rules)
1313
const browserhacks = require('./browserhacks.js')(
@@ -24,8 +24,7 @@ module.exports = ({
2424
})
2525

2626
return {
27-
size: filesize.uncompressed.totalBytes,
28-
filesize,
27+
size,
2928
simplicity,
3029
cohesion,
3130
browserhacks,

test/analyzer/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,12 @@ test('it returns the correct analysis object structure', async t => {
120120
'stylesheets.cohesion.average': 0,
121121
'stylesheets.cohesion.min.count': 0,
122122
'stylesheets.cohesion.min.value': null,
123-
'stylesheets.filesize.compressed.gzip.compressionRatio': -4,
124-
'stylesheets.filesize.compressed.gzip.totalBytes': 25,
125-
'stylesheets.filesize.uncompressed.totalBytes': 5,
123+
'stylesheets.size.compressed.gzip.compressionRatio': -4,
124+
'stylesheets.size.compressed.gzip.totalBytes': 25,
125+
'stylesheets.size.uncompressed.totalBytes': 5,
126126
'stylesheets.linesOfCode.sourceLinesOfCode.total': 1,
127127
'stylesheets.linesOfCode.total': 1,
128128
'stylesheets.simplicity': 1,
129-
'stylesheets.size': 5,
130129
'stylesheets.browserhacks.total': 0,
131130
'stylesheets.browserhacks.totalUnique': 0,
132131
'values.animations.durations.total': 0,

test/analyzer/stylesheets/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ const FIXTURE = {
2323

2424
test('it responds with the correct structure', t => {
2525
t.deepEqual(analyze(FIXTURE), {
26-
size: 0,
27-
filesize: {
26+
size: {
2827
uncompressed: {
2928
totalBytes: 0
3029
},

0 commit comments

Comments
 (0)