1
1
const tap = require ( 'tap' )
2
- const { satisfies } = require ( 'semver' )
3
2
4
3
const { CloudLogging } = require ( '../../lib/cloud-logging' )
5
4
@@ -973,11 +972,7 @@ tap.test('CloudLogging#sync', root => {
973
972
async t => {
974
973
let expectedEntry
975
974
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' ) ,
981
976
message : 'Malformed log entry'
982
977
}
983
978
class LogMock extends BaseLogMock {
@@ -994,7 +989,8 @@ tap.test('CloudLogging#sync', root => {
994
989
)
995
990
996
991
t . same ( meta , expectedMeta )
997
- t . same ( log , expectedLogEntry )
992
+ t . same ( log . message , 'Malformed log entry' )
993
+ t . type ( log . error , SyntaxError )
998
994
999
995
return (
1000
996
( expectedEntry = Object . assign ( { } , meta , {
@@ -1029,7 +1025,7 @@ tap.test('CloudLogging#sync', root => {
1029
1025
'@google-cloud/logging' : { Logging : LoggingMock }
1030
1026
} )
1031
1027
1032
- t . plan ( 3 )
1028
+ t . plan ( 4 )
1033
1029
1034
1030
const instance = new CloudLogging ( logName , defaultOptions )
1035
1031
@@ -1887,11 +1883,7 @@ tap.test('CloudLogging#async', root => {
1887
1883
async t => {
1888
1884
let expectedEntry
1889
1885
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' ) ,
1895
1887
message : 'Malformed log entry'
1896
1888
}
1897
1889
class LogMock extends BaseLogMock {
@@ -1908,7 +1900,8 @@ tap.test('CloudLogging#async', root => {
1908
1900
)
1909
1901
1910
1902
t . same ( meta , expectedMeta )
1911
- t . same ( log , expectedLogEntry )
1903
+ t . same ( log . message , 'Malformed log entry' )
1904
+ t . type ( log . error , SyntaxError )
1912
1905
1913
1906
return (
1914
1907
( expectedEntry = Object . assign ( { } , meta , {
@@ -1943,7 +1936,7 @@ tap.test('CloudLogging#async', root => {
1943
1936
'@google-cloud/logging' : { Logging : LoggingMock }
1944
1937
} )
1945
1938
1946
- t . plan ( 3 )
1939
+ t . plan ( 4 )
1947
1940
1948
1941
const instance = new CloudLogging ( logName , defaultOptions )
1949
1942
0 commit comments