rofrischmann/elodin

View on GitHub
utils/reason/src/__tests__/escapeKeywords-test.js

Summary

Maintainability
A
0 mins
Test Coverage
import { parse } from '@elodin/core'

import escapeKeywords from '../escapeKeywords'

describe('Escaping keywords', () => {
  it('should return a capitalized string', () => {
    const { ast } = parse(`
variant Type {
  Primary
  Secondary
}

style Button {
  color: $color
  backgroundColor: $bgColor
  
  [Type=Primary] {
    color: blue
  }
}
`)

    expect(
      escapeKeywords(ast, ['Type', 'Secondary', 'color'])
    ).toMatchSnapshot()
  })
})