@@ -20,8 +20,8 @@ const assert = require('assert');
2020
2121const getSample = ( ) => {
2222 const getProjectIdStub = sinon . stub ( ) . resolves ( 'test-project' ) ;
23- const listStub = sinon . stub ( ) . resolves ( [ { items : [ { name : 'test-instance' } ] } ] ) ;
24- const patchStub = sinon . stub ( ) . resolves ( [ { name : 'test-operation' } ] ) ;
23+ const listStub = sinon . stub ( ) . resolves ( [ { items : [ { name : 'test-instance' } ] } ] ) ;
24+ const patchStub = sinon . stub ( ) . resolves ( [ { name : 'test-operation' } ] ) ;
2525 const registeredFunctions = { } ;
2626
2727 proxyquire ( '../index' , {
@@ -38,7 +38,7 @@ const getSample = () => {
3838 } ,
3939 } ,
4040 } ) ;
41-
41+ cd
4242 return {
4343 registeredFunctions,
4444 mocks : {
@@ -49,7 +49,7 @@ const getSample = () => {
4949 } ;
5050} ;
5151
52- const getCloudEvent = ( data ) => ( {
52+ const getCloudEvent = data => ( {
5353 data : {
5454 message : {
5555 data : Buffer . from ( JSON . stringify ( data ) ) . toString ( 'base64' ) ,
@@ -73,7 +73,7 @@ afterEach(restoreConsole);
7373describe ( 'functions_start_instance_event' , ( ) => {
7474 it ( 'startInstanceEvent: should accept CloudEvent payload with label' , async ( ) => {
7575 const sample = getSample ( ) ;
76- const cloudEvent = getCloudEvent ( { label : 'env=dev' } ) ;
76+ const cloudEvent = getCloudEvent ( { label : 'env=dev' } ) ;
7777
7878 await sample . registeredFunctions . startInstanceEvent ( cloudEvent ) ;
7979
@@ -97,7 +97,7 @@ describe('functions_start_instance_event', () => {
9797
9898 it ( "startInstanceEvent: should fail with missing 'label' attribute" , async ( ) => {
9999 const sample = getSample ( ) ;
100- const cloudEvent = getCloudEvent ( { other : 'value' } ) ;
100+ const cloudEvent = getCloudEvent ( { other : 'value' } ) ;
101101
102102 await assert . rejects (
103103 sample . registeredFunctions . startInstanceEvent ( cloudEvent ) ,
@@ -108,7 +108,7 @@ describe('functions_start_instance_event', () => {
108108 it ( 'startInstanceEvent: should handle zero instances gracefully' , async ( ) => {
109109 const sample = getSample ( ) ;
110110 sample . mocks . listStub . resolves ( [ { } ] ) ; // Empty object missing 'items' property
111- const cloudEvent = getCloudEvent ( { label : 'env=dev' } ) ;
111+ const cloudEvent = getCloudEvent ( { label : 'env=dev' } ) ;
112112
113113 await sample . registeredFunctions . startInstanceEvent ( cloudEvent ) ;
114114
@@ -135,7 +135,7 @@ describe('functions_start_instance_event', () => {
135135describe ( 'functions_stop_instance_event' , ( ) => {
136136 it ( 'stopInstanceEvent: should accept CloudEvent payload with label' , async ( ) => {
137137 const sample = getSample ( ) ;
138- const cloudEvent = getCloudEvent ( { label : 'env=dev' } ) ;
138+ const cloudEvent = getCloudEvent ( { label : 'env=dev' } ) ;
139139
140140 await sample . registeredFunctions . stopInstanceEvent ( cloudEvent ) ;
141141
@@ -159,7 +159,7 @@ describe('functions_stop_instance_event', () => {
159159
160160 it ( "stopInstanceEvent: should fail with missing 'label' attribute" , async ( ) => {
161161 const sample = getSample ( ) ;
162- const cloudEvent = getCloudEvent ( { other : 'value' } ) ;
162+ const cloudEvent = getCloudEvent ( { other : 'value' } ) ;
163163
164164 await assert . rejects (
165165 sample . registeredFunctions . stopInstanceEvent ( cloudEvent ) ,
@@ -169,8 +169,8 @@ describe('functions_stop_instance_event', () => {
169169
170170 it ( 'stopInstanceEvent: should handle zero instances gracefully' , async ( ) => {
171171 const sample = getSample ( ) ;
172- sample . mocks . listStub . resolves ( [ { items : [ ] } ] ) ; // Empty items array
173- const cloudEvent = getCloudEvent ( { label : 'env=dev' } ) ;
172+ sample . mocks . listStub . resolves ( [ { items : [ ] } ] ) ; // Empty items array
173+ const cloudEvent = getCloudEvent ( { label : 'env=dev' } ) ;
174174
175175 await sample . registeredFunctions . stopInstanceEvent ( cloudEvent ) ;
176176
0 commit comments