@@ -19,6 +19,7 @@ import {
1919 writeJson ,
2020 WorkspaceConfiguration ,
2121 ProjectConfiguration ,
22+ joinPathFragments ,
2223} from '@nrwl/devkit' ;
2324
2425import { PackageJson , TsConfig } from '../../types' ;
@@ -1256,6 +1257,63 @@ describe('migrate-converged-pkg generator', () => {
12561257 } ) ;
12571258 } ) ;
12581259
1260+ describe ( `update conformance setup` , ( ) => {
1261+ const conformanceSetup = stripIndents `
1262+ import { isConformant as baseIsConformant } from '@proj/react-conformance';
1263+ import type { IsConformantOptions, TestObject } from '@proj/react-conformance';
1264+ import griffelTests from '@proj/react-conformance-griffel';
1265+
1266+ export function isConformant<TProps = {}>(
1267+ testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & { componentPath?: string },
1268+ ) {
1269+ const defaultOptions: Partial<IsConformantOptions<TProps>> = {
1270+ componentPath: require.main?.filename.replace('.test', ''),
1271+ extraTests: griffelTests as TestObject<TProps>,
1272+ testOptions: {
1273+ 'make-styles-overrides-win': {
1274+ callCount: 2,
1275+ },
1276+ // TODO: https://github.com/microsoft/fluentui/issues/19618
1277+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1278+ } as any,
1279+ };
1280+
1281+ baseIsConformant(defaultOptions, testInfo);
1282+ }
1283+ ` ;
1284+ it ( `should use tsConfig conformance API` , async ( ) => {
1285+ const projectConfig = readProjectConfiguration ( tree , options . name ) ;
1286+ const conformanceSetupPath = joinPathFragments ( projectConfig . root as string , 'src/testing/isConformant.ts' ) ;
1287+ tree . write ( conformanceSetupPath , conformanceSetup ) ;
1288+ await generator ( tree , options ) ;
1289+
1290+ expect ( tree . read ( conformanceSetupPath , 'utf-8' ) ) . toMatchInlineSnapshot ( `
1291+ "import { isConformant as baseIsConformant } from '@proj/react-conformance';
1292+ import type { IsConformantOptions, TestObject } from '@proj/react-conformance';
1293+ import griffelTests from '@proj/react-conformance-griffel';
1294+
1295+ export function isConformant<TProps = {}>(
1296+ testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & { componentPath?: string },
1297+ ) {
1298+ const defaultOptions: Partial<IsConformantOptions<TProps>> = {
1299+ tsConfig: { configName: 'tsconfig.spec.json' },
1300+ componentPath: require.main?.filename.replace('.test', ''),
1301+ extraTests: griffelTests as TestObject<TProps>,
1302+ testOptions: {
1303+ 'make-styles-overrides-win': {
1304+ callCount: 2,
1305+ },
1306+ // TODO: https://github.com/microsoft/fluentui/issues/19618
1307+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1308+ } as any,
1309+ };
1310+
1311+ baseIsConformant(defaultOptions, testInfo);
1312+ }"
1313+ ` ) ;
1314+ } ) ;
1315+ } ) ;
1316+
12591317 describe ( `--stats` , ( ) => {
12601318 it ( `should print project names and count of how many have been migrated` , async ( ) => {
12611319 const loggerInfoSpy = jest . spyOn ( logger , 'info' ) ;
0 commit comments