/
githubmirror
/
material-ui
Обзор
Документация
Войти
/
githubmirror
/
material-ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
packages/mui-material/src/index.test.js
39 строк
1 KB
Diego Andai
[material-ui][mui-system] Simplify version prerelease export (#43699)
11 сен 2024, 15:20
Не верифицирован
11 сен 2024, 15:20
494c10c
Код
Авторство
О чём код?
/* eslint import/namespace: ['error', { allowComputed: true }] */ /** * Important: This test also serves as a point to * import the entire lib for coverage reporting */ import { expect } from 'chai'; import * as MaterialUI from './index'; // To skip them in the undefined exports test // These are checked in the build process (scripts/build.mjs) const versionExports = ['version', 'major', 'minor', 'patch', 'prerelease']; describe('material-ui', () => { it('should have exports', () => { expect(typeof MaterialUI).to.equal('object'); }); it('should not have undefined exports', () => { Object.keys(MaterialUI) .filter((exportKey) => !versionExports.includes(exportKey)) .forEach((exportKey) => expect(Boolean(MaterialUI[exportKey])).to.equal(true)); }); it('should reexport certain members from @mui/base', () => { const expectedReexports = [ 'ClickAwayListener', 'generateUtilityClass', 'generateUtilityClasses', 'NoSsr', 'Portal', 'TextareaAutosize', 'unstable_composeClasses', ]; const exportedNames = Object.keys(MaterialUI); expectedReexports.forEach((reexport) => expect(exportedNames).to.contain(reexport)); }); });