I am testing a nodejs application. Where do I find this error when I run the test. Test script below:
.expect( (res) => { expect(res.headers['x-auth']).toExist(); expect(res.body._id).toExist(); expect(res.body.email).toBe(email); })
the error showed:
TypeError: expect(...).toExist is not a function
how can i solve this problem? TIA.
A library of pending expectations has changed ownership. It was transferred to the Jest team, which in its infinite wisdom created a new API .
'toBeTruthy()' 'toExist()'. - , , "npm install expect --save-dev", 21.2.1. , , "toExist()".
npm install expect --save-dev
Jest, 'toBeDefined()'
Source: https://habr.com/ru/post/1686445/More articles:Install IndexIgnore inside httpd.conf - modulelife cycle akka-stream + akka-http - scalaDividerItemDecoration - remove the last separator - androidВысокая латентность для достижения контейнера докера после того, как рой некоторое время простаивал - dockerImplement thread safe ArrayList in Java by blocking - javaiOS 11 - UINavigationItem titleView when using large title mode - iosHow to eliminate the dependence of the annotation processor on ProGuard - javaHow to break a long big title in iOS 11? - swiftHomebrew OSX Sierra No such PSQL file or directory postgres@9.5 - postgresqlRun multiple angular 4 applications with a common node js server (rendering) - angularAll Articles