Skip to content

migration(babel-make-styles): after migrating via nx generator, tests don't work #18757

@Hotell

Description

@Hotell

Describe the issue:

After migrating babel-make-styles to new dx via nx workspace-generator migrate-converged-pkg, tests will fail to pass.

Issue: Looks like code within __fixtures__ is not being transpiled, thus throwing an error:

2021-06-29 at 16 58

Previously it relied on running build prior to running tests

build => lib/__fixtures__/....compiled_code_to_common_js => run test => test consume `lib/*` instead of `src/*` 

Repro:

yarn nx workspace-generator migrate-converged-pkg --name='@fluentui/babel-make-styles'

rm -rf packages/babel-make-styles/.storybook

update tsconfig.json to keep the original target/lib

{
  "extends": "../../tsconfig.base.json",
  "include": ["__fixtures__/**/code.ts", "src"],
  "compilerOptions": {
    "target": "ES2015",
    "module": "CommonJS",
    "lib": ["ES2017","DOM"],
    "jsx": "react",
    "outDir": "dist",
    "declaration": true,
    "experimentalDecorators": true,
    "importHelpers": true,
    "noUnusedLocals": true,
    "preserveConstEnums": true,
    "types": ["jest", "custom-global", "inline-style-expand-shorthand", "node", "babel-helper-plugin-utils"]
  }
}

execute

yarn workspace @fluentui/babel-make-styles test --no-cache

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions