Skip to content
This repository was archived by the owner on May 14, 2021. It is now read-only.

Commit 8274160

Browse files
committed
initial add of breaking test suite
1 parent 966d6ce commit 8274160

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import styled from 'styled-components';
2+
3+
const Content = styled.section`
4+
5+
${props => props.centered &&
6+
`
7+
text-align: center;
8+
`}
9+
10+
a {
11+
color: ${({ theme }) => theme.colors.lightBlue};
12+
font-weight: bold;
13+
transition: 0.3s color ease-in;
14+
text-decoration: none;
15+
}
16+
17+
strong {
18+
font-weight: 600;
19+
}
20+
ul,
21+
ol {
22+
margin: 0;
23+
}
24+
`;
25+
26+
export default Content;

test/real-world.test.js

+30
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ const path = require('path')
77

88
const processor = path.join(__dirname, '../src/index.js')
99
const rules = {
10+
'rule-empty-line-before': [
11+
'always-multi-line',
12+
{
13+
except: ['first-nested'],
14+
ignore: ['after-comment']
15+
}
16+
],
1017
'block-no-empty': true,
1118
indentation: 2
1219
}
@@ -58,4 +65,27 @@ describe('real world failures', () => {
5865
expect(data.results[0].warnings).toEqual([])
5966
})
6067
})
68+
69+
describe('Line Numbers Report Correctly', () => {
70+
beforeAll(() => {
71+
fixture = path.join(__dirname, './fixtures/real-world/LineNumbersReportedAccurate.js')
72+
})
73+
74+
it('should have one result', () => {
75+
expect(data.results.length).toEqual(1)
76+
})
77+
78+
it('should use the right file', () => {
79+
expect(data.results[0].source).toEqual(fixture)
80+
})
81+
82+
it('should not have errored', () => {
83+
expect(data.errored).toEqual(true)
84+
})
85+
86+
it('should identify the line number correctly', () => {
87+
const errorLine = 20
88+
expect(data.results[0].warnings[0].line).toEqual(errorLine)
89+
})
90+
})
6191
})

0 commit comments

Comments
 (0)