66 assertActiveWorkerReleaseBindings ,
77 assertDeploymentReceiptBindings ,
88 assertFrozenDryRunProjection ,
9+ hasExpectedDryRunShape ,
910 qualifiedContainerImage ,
1011 selectQualifiedContainer ,
1112} from "./create-deployment-receipt" ;
@@ -42,6 +43,11 @@ const generationIsolationProbeSha256 =
4243
4344describe ( "deployment receipt frozen dry-run projection" , ( ) => {
4445 const workerBundleSha256 = "a" . repeat ( 64 ) ;
46+ const file = ( name : string ) => ( {
47+ name,
48+ isFile : ( ) => true ,
49+ isSymbolicLink : ( ) => false ,
50+ } ) ;
4551
4652 it ( "accepts exactly one byte-identical Worker bundle" , ( ) => {
4753 expect ( ( ) =>
@@ -53,6 +59,32 @@ describe("deployment receipt frozen dry-run projection", () => {
5359 ) . not . toThrow ( ) ;
5460 } ) ;
5561
62+ it ( "accepts the exact Wrangler files independent of directory order" , ( ) => {
63+ const readme = file ( "README.md" ) ;
64+ const worker = file ( "index.js" ) ;
65+
66+ expect ( hasExpectedDryRunShape ( [ readme , worker ] ) ) . toBe ( true ) ;
67+ expect ( hasExpectedDryRunShape ( [ worker , readme ] ) ) . toBe ( true ) ;
68+ } ) ;
69+
70+ it ( "rejects extra, non-file, and symbolic-link entries" , ( ) => {
71+ const readme = file ( "README.md" ) ;
72+ const worker = file ( "index.js" ) ;
73+
74+ expect (
75+ hasExpectedDryRunShape ( [ readme , worker , file ( "metadata.json" ) ] ) ,
76+ ) . toBe ( false ) ;
77+ expect (
78+ hasExpectedDryRunShape ( [ readme , { ...worker , isFile : ( ) => false } ] ) ,
79+ ) . toBe ( false ) ;
80+ expect (
81+ hasExpectedDryRunShape ( [
82+ readme ,
83+ { ...worker , isSymbolicLink : ( ) => true } ,
84+ ] ) ,
85+ ) . toBe ( false ) ;
86+ } ) ;
87+
5688 it ( "rejects changed Worker bytes and every non-singleton projection" , ( ) => {
5789 expect ( ( ) =>
5890 assertFrozenDryRunProjection ( {
0 commit comments