11const tap = require ( 'tap' )
2- const { satisfies } = require ( 'semver' )
32
43const { CloudLogging } = require ( '../../lib/cloud-logging' )
54
@@ -973,11 +972,7 @@ tap.test('CloudLogging#sync', root => {
973972 async t => {
974973 let expectedEntry
975974 const expectedLogEntry = {
976- error : ! satisfies ( process . versions . node , '>=20.x' )
977- ? new SyntaxError ( 'Unexpected token { in JSON at position 1' )
978- : new SyntaxError (
979- "Expected property name or '}' in JSON at position 1"
980- ) ,
975+ error : new SyntaxError ( 'Unexpected token { in JSON at position 1' ) ,
981976 message : 'Malformed log entry'
982977 }
983978 class LogMock extends BaseLogMock {
@@ -994,7 +989,8 @@ tap.test('CloudLogging#sync', root => {
994989 )
995990
996991 t . same ( meta , expectedMeta )
997- t . same ( log , expectedLogEntry )
992+ t . same ( log . message , 'Malformed log entry' )
993+ t . type ( log . error , SyntaxError )
998994
999995 return (
1000996 ( expectedEntry = Object . assign ( { } , meta , {
@@ -1029,7 +1025,7 @@ tap.test('CloudLogging#sync', root => {
10291025 '@google-cloud/logging' : { Logging : LoggingMock }
10301026 } )
10311027
1032- t . plan ( 3 )
1028+ t . plan ( 4 )
10331029
10341030 const instance = new CloudLogging ( logName , defaultOptions )
10351031
@@ -1887,11 +1883,7 @@ tap.test('CloudLogging#async', root => {
18871883 async t => {
18881884 let expectedEntry
18891885 const expectedLogEntry = {
1890- error : ! satisfies ( process . versions . node , '>=20.x' )
1891- ? new SyntaxError ( 'Unexpected token { in JSON at position 1' )
1892- : new SyntaxError (
1893- "Expected property name or '}' in JSON at position 1"
1894- ) ,
1886+ error : new SyntaxError ( 'Unexpected token { in JSON at position 1' ) ,
18951887 message : 'Malformed log entry'
18961888 }
18971889 class LogMock extends BaseLogMock {
@@ -1908,7 +1900,8 @@ tap.test('CloudLogging#async', root => {
19081900 )
19091901
19101902 t . same ( meta , expectedMeta )
1911- t . same ( log , expectedLogEntry )
1903+ t . same ( log . message , 'Malformed log entry' )
1904+ t . type ( log . error , SyntaxError )
19121905
19131906 return (
19141907 ( expectedEntry = Object . assign ( { } , meta , {
@@ -1943,7 +1936,7 @@ tap.test('CloudLogging#async', root => {
19431936 '@google-cloud/logging' : { Logging : LoggingMock }
19441937 } )
19451938
1946- t . plan ( 3 )
1939+ t . plan ( 4 )
19471940
19481941 const instance = new CloudLogging ( logName , defaultOptions )
19491942
0 commit comments