Skip to content

Commit

Permalink
Adding some tests for config file resolving
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrohan committed Apr 19, 2024
1 parent 9117032 commit 5e920a6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions __tests__/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {lint} from './utils/index.js'
import stylelint from 'stylelint'

const SAFE_SCSS_EXAMPLE = `
.Component { float: left; }
Expand Down Expand Up @@ -48,4 +49,19 @@ describe('stylelint-config', () => {
expect(data).toHaveDeprecationsLength(0)
})
})

it('resolves css files correctly', async () => {
const config = await stylelint.resolveConfig('./__fixtures__/good/example.css');
expect(config).not.toHaveProperty('customSyntax')
})

it('resolves tsx files correctly', async () => {
const config = await stylelint.resolveConfig('./__fixtures__/good/example.tsx');
expect(config).toHaveProperty('customSyntax', 'postcss-styled-syntax')
})

it('resolves scss files correctly', async () => {
const config = await stylelint.resolveConfig('./__fixtures__/good/example.scss');
expect(config).toHaveProperty('customSyntax', 'postcss-scss')
})
})

0 comments on commit 5e920a6

Please sign in to comment.