Convenience sigils for JavaScript, TypeScript, JSX, TSX, CSS, and HTML test fixtures.
These sigils are intentionally small: they return normalized source strings for
ExUnit tests and examples. Use the optional v modifier to validate JS/TS-like
snippets with OXC at runtime.
import Volt.Test.Sigils
source = ~TS"const answer: number = 42"
assert source =~ "answer"
# Validate parser compatibility when the snippet is expected to be valid.
source = ~TS"export const value: string = "ok""vThe multi-letter sigils are intentionally uppercase, which means Elixir does not process escapes or interpolation before the source reaches Volt. This is usually what JS/TS fixtures want.
Summary
Functions
Returns normalized CSS source.
Returns normalized HTML source.
Returns normalized JavaScript source. Use v to validate with OXC.
Returns normalized JSX source. Use v to validate with OXC.
Returns normalized TypeScript source. Use v to validate with OXC.
Returns normalized TSX source. Use v to validate with OXC.
Functions
Returns normalized CSS source.
Returns normalized HTML source.
Returns normalized JavaScript source. Use v to validate with OXC.
Returns normalized JSX source. Use v to validate with OXC.
Returns normalized TypeScript source. Use v to validate with OXC.
Returns normalized TSX source. Use v to validate with OXC.