@@ -45,7 +45,7 @@ function cruise(
4545 mkdirSync ( dirname ( join ( directory , name ) ) , { recursive : true } ) ;
4646 writeFileSync ( join ( directory , name ) , source ) ;
4747 }
48- const result = spawnSync ( process . execPath , [ cli , "src " , "--output-type " , "err " ] , {
48+ const result = spawnSync ( process . execPath , [ cli , "--config " , ".dependency-cruiser.cjs " , "src " ] , {
4949 cwd : directory ,
5050 encoding : "utf8" ,
5151 timeout : 20_000 ,
@@ -73,6 +73,15 @@ const forbidden: [string, Files][] = [
7373 [ "no-src-to-tests" , { "src/main.ts" : 'import "../tests/helper.js";' , "tests/helper.ts" : "export const x = 1;" } ] ,
7474 [ "not-to-dev-dep" , { "src/main.test.ts" : 'import { test } from "vitest";' } ] ,
7575 [ "no-app-to-bootstrap" , { "src/common/helper.ts" : 'import "../init.js";' , "src/init.ts" : "export const x = 1;" } ] ,
76+ [
77+ "no-root-to-screen" ,
78+ {
79+ "src/main.ts" : 'import "./intro/Screen.js";' ,
80+ "src/intro/Screen.ts" : 'import "../root-helper.js";' ,
81+ "src/root-helper.ts" : 'export * from "./lab/Screen.js";' ,
82+ "src/lab/Screen.ts" : "export const screen = 1;" ,
83+ } ,
84+ ] ,
7685 [
7786 "no-model-to-view" ,
7887 { "src/lab/model/Model.ts" : 'import "../view/View.js";' , "src/lab/view/View.ts" : "export const x = 1;" } ,
@@ -148,6 +157,15 @@ test("allows bootstrap metadata, same-screen imports, shared models, and type-on
148157 assert . equal ( result . status , 0 ) ;
149158} ) ;
150159
160+ test ( "uses the fleet config when another default config is present" , ( ) => {
161+ const result = cruise ( {
162+ ".dependency-cruiser.json" : '{ "forbidden": [] }' ,
163+ "src/main.ts" : 'import "./missing.js";' ,
164+ } ) ;
165+ assert . deepEqual ( violations ( result ) , [ "no-unresolved" ] , result . stdout ) ;
166+ assert . notEqual ( result . status , 0 ) ;
167+ } ) ;
168+
151169const source = { "src/main.ts" : 'import "./missing.js";' } ;
152170const failClosedOverlays : [ string , string ] [ ] = [
153171 [ "missing overlay dependency" , 'require("./absent.cjs");' ] ,
0 commit comments