Allowable tags are defined in src/_data/tagList.js
. The exceptions
key is used in eleventy/nunjucksShortcodes/normalizeTagName.js
, and the list itself is used in scripts/validateFrontmatter/schemas/eleventy.ts
.
clear && TS_NODE_PROJECT="tsconfig.gulp.json" yarn gulp build
clear && TS_NODE_PROJECT="tsconfig.jest.json" yarn jest eleventy/nunjucksAsyncShortcodes/asyncImageHandler/utils.spec.js --projects test/jest/jest.config.node.ts
clear && egrep -rnw './' --exclude-dir=node_modules --exclude-dir=.yarn --exclude-dir=yarn.lock --exclude-dir=public --exclude-dir=.cache -e 'searchString'
npx jest --clearCache
For install errors that report error installing sharp, recommended install. See jest.setup.jsdom.ts
:
npm install --platform=linux --arch=x64 sharp
document.querySelector('.contact___callout-flex')
document.getElementById('header__theme-icon').getBoundingClientRect().width
document.activeElement
import '@testing-library/jest-dom';
import 'html-validate/jest';
import React from 'react';
import { renderToStaticMarkup } from 'react-dom/server';
import { BraidTestProvider } from '../../../entries/test';
import { Button, IconSend } from '..';
describe('Button', () => {
it('should render valid html structure', () => {
expect(
renderToStaticMarkup(
<BraidTestProvider>
<Button>Button</Button>
<Button icon={<IconSend />}>Button</Button>
</BraidTestProvider>,
),
).toHTMLValidate({
extends: ['html-validate:recommended'],
});
});
});