@@ -53,26 +53,29 @@ describe('load-module-boundaries', () => {
5353 expect ( boundaries ) . toEqual ( MOCK_BOUNDARIES ) ;
5454 } ) ;
5555
56- it ( 'should load from eslint if boundaries not in config' , async ( ) => {
57- const eslintConfigSpy = jest
58- . spyOn ( ESLintNamespace , 'ESLint' )
59- . mockReturnValue ( {
60- calculateConfigForFile : jest . fn ( ) . mockResolvedValue ( {
61- rules : {
62- '@nrwl/nx/enforce-module-boundaries' : [
63- 1 ,
64- { depConstraints : MOCK_BOUNDARIES } ,
65- ] ,
66- } ,
67- } ) ,
68- } as unknown as ESLintNamespace . ESLint ) ;
69- writeJson < NxDotnetConfig > ( appTree , CONFIG_FILE_PATH , {
70- nugetPackages : { } ,
71- } ) ;
72- const boundaries = await loadModuleBoundaries ( '' , appTree ) ;
73- expect ( eslintConfigSpy ) . toHaveBeenCalledTimes ( 1 ) ;
74- expect ( boundaries ) . toEqual ( MOCK_BOUNDARIES ) ;
75- } ) ;
56+ it . each ( [
57+ '@nrwl/nx/enforce-module-boundaries' ,
58+ '@nx/enforce-module-boundaries' ,
59+ ] ) (
60+ 'should load from eslint if boundaries not in config' ,
61+ async ( eslintRuleName ) => {
62+ const eslintConfigSpy = jest
63+ . spyOn ( ESLintNamespace , 'ESLint' )
64+ . mockReturnValue ( {
65+ calculateConfigForFile : jest . fn ( ) . mockResolvedValue ( {
66+ rules : {
67+ [ eslintRuleName ] : [ 1 , { depConstraints : MOCK_BOUNDARIES } ] ,
68+ } ,
69+ } ) ,
70+ } as unknown as ESLintNamespace . ESLint ) ;
71+ writeJson < NxDotnetConfig > ( appTree , CONFIG_FILE_PATH , {
72+ nugetPackages : { } ,
73+ } ) ;
74+ const boundaries = await loadModuleBoundaries ( '' , appTree ) ;
75+ expect ( eslintConfigSpy ) . toHaveBeenCalledTimes ( 1 ) ;
76+ expect ( boundaries ) . toEqual ( MOCK_BOUNDARIES ) ;
77+ } ,
78+ ) ;
7679} ) ;
7780
7881// eslint-disable-next-line @typescript-eslint/no-var-requires
@@ -84,7 +87,7 @@ describe('enforce-module-boundaries', () => {
8487 jest . spyOn ( ESLintNamespace , 'ESLint' ) . mockReturnValue ( {
8588 calculateConfigForFile : jest . fn ( ) . mockResolvedValue ( {
8689 rules : {
87- '@nrwl/ nx/enforce-module-boundaries' : [
90+ '@nx/enforce-module-boundaries' : [
8891 1 ,
8992 { depConstraints : MOCK_BOUNDARIES } ,
9093 ] ,
0 commit comments