Files
30-seconds-of-code/node_modules/babel-plugin-macros/dist/__tests__/create-macros.js
2019-08-20 15:52:05 +02:00

15 lines
448 B
JavaScript

const {createMacro} = require('../')
test('throws error if it is not transpiled', () => {
const untranspiledMacro = createMacro(() => {})
expect(() =>
untranspiledMacro({source: 'untranspiled.macro'}),
).toThrowErrorMatchingSnapshot()
})
test('attempting to create a macros with the configName of options throws an error', () => {
expect(() =>
createMacro(() => {}, {configName: 'options'}),
).toThrowErrorMatchingSnapshot()
})