File tree Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,9 @@ const assert = require('node:assert')
33let subscribe
44
55// Simple function tracker to replace sinon
6- function createFake ( ) {
6+ function createFake ( ) {
77 const calls = [ ]
8- const fake = function ( ...args ) {
8+ function fake ( ...args ) {
99 calls . push ( args )
1010 if ( fake . _callback ) {
1111 fake . _callback ( ...args )
@@ -15,7 +15,7 @@ function createFake() {
1515 return calls . some ( call => JSON . stringify ( call [ 0 ] ) === JSON . stringify ( expectedArg ) )
1616 }
1717 fake . yields = ( ) => {
18- fake . _callback = function ( ...args ) {
18+ fake . _callback = function ( ...args ) {
1919 const callback = args [ args . length - 1 ]
2020 if ( typeof callback === 'function' ) {
2121 callback ( )
Original file line number Diff line number Diff line change @@ -4,10 +4,10 @@ let mockSqsEvent = require('../../../mock/mock-sqs-event.json')
44let subscribe
55
66// Simple function tracker to replace sinon
7- function createFake ( ) {
7+ function createFake ( ) {
88 const calls = [ ]
99 let callCount = 0
10- const fake = function ( ...args ) {
10+ function fake ( ...args ) {
1111 calls . push ( args )
1212 callCount ++
1313 if ( fake . _callback ) {
@@ -16,7 +16,7 @@ function createFake() {
1616 }
1717 fake . calledOnce = ( ) => callCount === 1
1818 fake . yields = ( ) => {
19- fake . _callback = function ( ...args ) {
19+ fake . _callback = function ( ...args ) {
2020 const callback = args [ args . length - 1 ]
2121 if ( typeof callback === 'function' ) {
2222 callback ( )
Original file line number Diff line number Diff line change 1- const { test, mock } = require ( 'node:test' )
1+ const { test } = require ( 'node:test' )
22const assert = require ( 'node:assert' )
33const Module = require ( 'module' )
44
55let manifestExists = true
66
77// Mock fs module using Node.js native module mocking
88const originalRequire = Module . prototype . require
9- Module . prototype . require = function ( id ) {
9+ Module . prototype . require = function ( id ) {
1010 if ( id === 'fs' ) {
1111 return {
1212 readFileSync : ( ) => JSON . stringify ( {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const noop = () => {}
1010
1111// Mock the legacy module using Node.js native module mocking
1212const originalRequire = Module . prototype . require
13- Module . prototype . require = function ( id ) {
13+ Module . prototype . require = function ( id ) {
1414 if ( id === './legacy' ) {
1515 return ( ) => ( { db : noop , doc : noop } )
1616 }
You can’t perform that action at this time.
0 commit comments