Invoking: npm run lint && npm run test:unit && npm run test:schema > fabric-contract-api@2.5.8 lint > eslint ./lib ./types ./test/typescript/*.ts --ext .js --ext .ts ============= WARNING: You are currently running a version of TypeScript which is not officially supported by typescript-estree. You may find that it works just fine, or you may not. SUPPORTED TYPESCRIPT VERSIONS: >=3.2.1 <3.7.0 YOUR TYPESCRIPT VERSION: 4.4.4 Please only submit bug reports when using the officially supported version. ============= /home/runner/work/fabric-chaincode-node/fabric-chaincode-node/apis/fabric-contract-api/types/index.d.ts 27:49 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any 28:69 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any 39:26 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any 39:38 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any 40:41 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any 40:69 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any 43:61 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any 44:97 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any 45:60 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any 46:53 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any 47:51 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any 48:70 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any 49:41 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any /home/runner/work/fabric-chaincode-node/fabric-chaincode-node/apis/fabric-contract-api/test/typescript/smartcontract.ts 35:52 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any 41:71 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any ✖ 15 problems (0 errors, 15 warnings) > fabric-contract-api@2.5.8 test:unit > npm run test > fabric-contract-api@2.5.8 test > nyc mocha --recursive 'test/unit/**/*.js' Default.js Default 2024-12-04T09:27:11.473Z info [c-api:./lib/annotations/default.js] @Default args: "Target ->","mockTarget" ✔ should add set value for default when none set 2024-12-04T09:27:11.477Z info [c-api:./lib/annotations/default.js] @Default args: "Target ->","mockTarget" ✔ should error when default already set Info.js Info 2024-12-04T09:27:11.479Z info [c-api:./lib/annotations/info.js] @Info args: "Info -> [object Object],","Target ->","steve" ✔ should add object as key when no objects exist for global yet 2024-12-04T09:27:11.481Z info [c-api:./lib/annotations/info.js] @Info args: "Info -> [object Object],","Target ->","steve" ✔ should add object as key when objects exist for global Info with data 2024-12-04T09:27:11.482Z info [c-api:./lib/annotations/info.js] @Info args: "Info -> [object Object],","Target ->","steve" ✔ should add object as key when no objects exist for global yet 2024-12-04T09:27:11.484Z info [c-api:./lib/annotations/info.js] @Info args: "Info -> [object Object],","Target ->","steve" ✔ should add object as key when objects exist for global Object.js #Object 2024-12-04T09:27:11.486Z info [c-api:./lib/annotations/object.js] @Object args: Target -> %s "Function" ✔ should add object as key when no objects exist for global yet 2024-12-04T09:27:11.488Z info [c-api:./lib/annotations/object.js] @Object args: Target -> %s "Function" ✔ should add object as key when objects exist for global 2024-12-04T09:27:11.489Z info [c-api:./lib/annotations/object.js] @Object args: Target -> %s "Function" ✔ should add object with no supertype 2024-12-04T09:27:11.491Z info [c-api:./lib/annotations/object.js] @Object args: Target -> %s "Function" ✔ should add object with no supertype, and no expected subtypes #Property ✔ should use the type and name passed ✔ should handle the reflected type being a function when type not passed ✔ should handle the reflected type being a function when type not passed Transaction.js Transaction 2024-12-04T09:27:11.497Z info [c-api:./lib/annotations/transaction.js] @Transaction args: "Property Key -> mockKey, Commit -> true,","Target ->","Object" ✔ should handle existing transactions 2024-12-04T09:27:11.499Z info [c-api:./lib/annotations/transaction.js] @Transaction args: "Property Key -> mockKey, Commit -> true,","Target ->","Object" ✔ should error if missing type 2024-12-04T09:27:11.500Z info [c-api:./lib/annotations/transaction.js] @Transaction args: "Property Key -> mockKey, Commit -> true,","Target ->","Object" ✔ should handle existing transactions of which matches name and already has param metadata 2024-12-04T09:27:11.502Z info [c-api:./lib/annotations/transaction.js] @Transaction args: "Property Key -> mockKey, Commit -> true,","Target ->","Object" ✔ should create new metadata for fabric:transactions if none exist and handle no params 2024-12-04T09:27:11.503Z info [c-api:./lib/annotations/transaction.js] @Transaction args: "Property Key -> mockKey, Commit -> false,","Target ->","Object" ✔ should not add a tag if commit is false Returns 2024-12-04T09:27:11.505Z info [c-api:./lib/annotations/transaction.js] @Returns args: ", Property Key -> mockKey, Return Type -> someType,","Target ->","Object" ✔ should handle existing transactions 2024-12-04T09:27:11.506Z info [c-api:./lib/annotations/transaction.js] @Returns args: ", Property Key -> mockKey, Return Type -> someType,","Target ->","Object" ✔ should handle when there are no existing transactions Param 2024-12-04T09:27:11.508Z info [c-api:./lib/annotations/transaction.js] @Param args: "Property Key -> mockKey, Param Name -> some param, Param Type -> some type, Description -> some description,","Target ->","Object" ✔ should overwrite when the transaction exists and param of name already in 2024-12-04T09:27:11.510Z info [c-api:./lib/annotations/transaction.js] @Param args: "Property Key -> mockKey, Param Name -> some param, Param Type -> some type, Description -> some description,","Target ->","Object" ✔ should overwrite existing transaction but add new param when one with name does not exist 2024-12-04T09:27:11.511Z info [c-api:./lib/annotations/transaction.js] @Param args: "Property Key -> mockKey, Param Name -> some param, Param Type -> some type, Description -> some description,","Target ->","Object" ✔ should append to transaction a new parameters array when transaction exists but has not parameters field 2024-12-04T09:27:11.513Z info [c-api:./lib/annotations/transaction.js] @Param args: "Property Key -> mockKey, Param Name -> some param, Param Type -> some type, Description -> some description,","Target ->","Object" ✔ should handle when no transaction exists 2024-12-04T09:27:11.514Z info [c-api:./lib/annotations/transaction.js] @Param args: "Property Key -> mockKey, Param Name -> some param, Param Type -> some type, Description -> undefined,","Target ->","Object" ✔ should handle when no description passed utils appendOrUpdate ✔ should push a new object into array made up of data passed if none existing with id ✔ should update existing object with data if id exists findByValue ✔ should return the element in the array with the passed value in the passed field ✔ should return null if no element has the passed value for the passed field generateSchema ✔ should return a primitive type ✔ should return a primitive type as lowercase ✔ should return a ref path for a non array and non primitive type ✔ should return a ref path for a non array and non primitive type and not use full path ✔ should recurse for array types ✔ should recurse for map types contract.js #constructor ✔ should create plain object ok ✔ should have set* methods contract.js #constructor ✔ should create with default name 2024-12-04T09:27:11.521Z error [c-api:./lib/contract.js] [some id] Contract contract-api.Contract unknown transaction "wibble", ✔ should have default unknownTx fn ✔ should create with the name specified ✔ should call the default before/after/around functions ✔ should call the default createContext functions ✔ should set the __isContract value _isContract ✔ should return true when class is a contract ✔ should return true when class is not a contract ✔ should return true when class is not instanceOf contract but does have __isContract true subclass specific functioning ✔ should set the correct name ✔ should call the correct subclassed fns jsontransactionserializer.js #constructor ✔ should create plain object ok #toBuffer ✔ should return undefined if nothing passed in (no schema) ✔ should return string from a string in result if schema given ✔ should return number from a number in result if schema given 2024-12-04T09:27:11.528Z error [c-api:./lib/jsontransactionserializer.js] undefined toBuffer validation against schema failed on type "number","string" ✔ should throw an error if the type of data passed does not match schema given ✔ should handle booleans ✔ should return string from a string in result if JS can tell ✔ should return number from a number in result if JS can tell ✔ should handle generic object ✔ should handle array of strings ✔ should handle array of objects #fromBuffer:obects ✔ Fully speced object ✔ Generic object - no type specificed #fromBuffer:primitives 2024-12-04T09:27:11.532Z error [c-api:./lib/jsontransactionserializer.js] undefined fromBuffer no data supplied ✔ should throw an error if nothing given ✔ should throw an error if not a number ✔ should throw an error if bad boolean given 2024-12-04T09:27:11.534Z error [c-api:./lib/jsontransactionserializer.js] fromBuffer could not parse data as JSON to allow it to be converted to type: "some type" "trie",{} 2024-12-04T09:27:11.534Z error [c-api:./lib/jsontransactionserializer.js] Converting data to string and JSON.stringify-ing ✔ should do cope with bad input and simply tostring if bad JSON used for non string or number type ✔ should handle specific String case ✔ should handle specific Number case ✔ should handle specific Boolean case ✔ should handle specific Number case ✔ should handle booleans ✔ should handle stuff that is really vague ✔ should handle buffer that is really vague ✔ should handle errors of unkown type ✔ should handle array of strings ✔ should handle array of objects Logger ✔ coverage 2024-12-04T09:27:11.539Z error [c-api:_] Unhandled Rejection reason __PERMITTED__ promise Promise { '__PERMITTED__' } 2024-12-04T09:27:11.539Z error [c-api:_] Unhandled Rejection reason __PERMITTED__ promise Promise { '__PERMITTED__' } getLogger ✔ should create a new logger name unknown ✔ should return existing logger if known name used ✔ should set the log level to fatal when env var set to CRITICAL ✔ should set the log level to error when env var set to ERROR ✔ should set the log level to warn when env var set to WARNING ✔ should set the log level to debug when env var set to DEBUG setLevel ✔ should update the loggers to be the level passed in formatter ✔ anonymous logger ✔ named logger 85 passing (75ms) =============================== Coverage summary =============================== Statements : 100% ( 336/336 ) Branches : 100% ( 157/157 ) Functions : 100% ( 56/56 ) Lines : 100% ( 333/333 ) ================================================================================ > fabric-contract-api@2.5.8 test:schema > ajv compile -s ./schema/contract-schema.json && ajv validate -s ./schema/contract-schema.json -d ./schema/example-full.json schema ./schema/contract-schema.json is valid ./schema/example-full.json valid