Testing loopback 3 with jest and supertest does not exit gracefullysupertest nodejs test get callMake Jest ignore the .less import when testingJest: Error: Your test suite must contain at least one testMissing module when running Jest tests with ArangodbUnable to send authenticated request in tests using Jest, Supertest, Passport, Koa2Jest + supertest in NodeJS, async/awaitNode Supertest with Mocha: Uncaught Error: read ECONNRESETJest has detected the following 1 open handle potentially keeping Jest from exitingTesting a file upload with jestHow to print the request and response when a test fails in Jest?
What happens if you do emergency landing on a US base in middle of the ocean?
How to supress loops in a digraph?
Initialize an std::array algorithmically at compile time
Avoiding cliches when writing gods
Working in the USA for living expenses only; allowed on VWP?
Opposite of "Squeaky wheel gets the grease"
How to skip replacing first occurrence of a character in each line?
Responsibility for visa checking
How can Iron Man's suit withstand this?
Convert camelCase and PascalCase to Title Case
Aligning system of equations with zero coefficients
What do we gain with higher order logics?
How to make a setting relevant?
Pros and cons of writing a book review?
What can plausibly explain many of my very long and low-tech bridges?
When writing an error prompt, should we end the sentence with a exclamation mark or a dot?
What are they doing to this rocket following it's test fire?
What makes linear regression with polynomial features curvy?
How do I write "Show, Don't Tell" as an Asperger
Can a magnetic field of an object be stronger than its gravity?
Movie where a boy is transported into the future by an alien spaceship
What's the correct term for a waitress in the Middle Ages?
How could a possessed body begin to rot and decay while it is still alive?
Short story written from alien perspective with this line: "It's too bright to look at, so they don't"
Testing loopback 3 with jest and supertest does not exit gracefully
supertest nodejs test get callMake Jest ignore the .less import when testingJest: Error: Your test suite must contain at least one testMissing module when running Jest tests with ArangodbUnable to send authenticated request in tests using Jest, Supertest, Passport, Koa2Jest + supertest in NodeJS, async/awaitNode Supertest with Mocha: Uncaught Error: read ECONNRESETJest has detected the following 1 open handle potentially keeping Jest from exitingTesting a file upload with jestHow to print the request and response when a test fails in Jest?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am trying to build a test using Jest and Supertest for my loopback 3 rest API server. The test is running, but Jest did not exit gracefully.
This is my test script branch.test.js:
const app = require('../server/server');
const request = require('supertest');
describe('Test the root path', () =>
afterAll(done =>
app.close(done);
);
test('It should response the GET method', async () =>
const response = await request(app).get('/api/branches');
expect(response.statusCode).toBe(200);
);
)
And package.json for test setting
"scripts":
"lint": "eslint .",
"start": "node .",
"posttest": "npm run lint",
"test": "jest --detectOpenHandles"
,
"jest":
"testEnvironment": "node"
Every time I run npm run test, the log always return:
Jest has detected the following 1 open handle potentially keeping Jest
from exiting:
● TCPWRAP
11 |
12 | test('It should response the GET method', async () => );
16 | })
at Test.Object..Test.serverAddress
(node_modules/supertest/lib/test.js:59:33)
at new Test (node_modules/supertest/lib/test.js:36:12)
at Object.obj.(anonymous function) [as get]
(node_modules/supertest/index.js:25:14)
at Object.get (test/unit/branch.test.js:13:45)
the log is pointing at get function. People in forum use jest --forceExit, but it is not the way I want. Are there any solutions for this problem? Thanks for the response
node.js testing jestjs loopbackjs supertest
add a comment |
I am trying to build a test using Jest and Supertest for my loopback 3 rest API server. The test is running, but Jest did not exit gracefully.
This is my test script branch.test.js:
const app = require('../server/server');
const request = require('supertest');
describe('Test the root path', () =>
afterAll(done =>
app.close(done);
);
test('It should response the GET method', async () =>
const response = await request(app).get('/api/branches');
expect(response.statusCode).toBe(200);
);
)
And package.json for test setting
"scripts":
"lint": "eslint .",
"start": "node .",
"posttest": "npm run lint",
"test": "jest --detectOpenHandles"
,
"jest":
"testEnvironment": "node"
Every time I run npm run test, the log always return:
Jest has detected the following 1 open handle potentially keeping Jest
from exiting:
● TCPWRAP
11 |
12 | test('It should response the GET method', async () => );
16 | })
at Test.Object..Test.serverAddress
(node_modules/supertest/lib/test.js:59:33)
at new Test (node_modules/supertest/lib/test.js:36:12)
at Object.obj.(anonymous function) [as get]
(node_modules/supertest/index.js:25:14)
at Object.get (test/unit/branch.test.js:13:45)
the log is pointing at get function. People in forum use jest --forceExit, but it is not the way I want. Are there any solutions for this problem? Thanks for the response
node.js testing jestjs loopbackjs supertest
add a comment |
I am trying to build a test using Jest and Supertest for my loopback 3 rest API server. The test is running, but Jest did not exit gracefully.
This is my test script branch.test.js:
const app = require('../server/server');
const request = require('supertest');
describe('Test the root path', () =>
afterAll(done =>
app.close(done);
);
test('It should response the GET method', async () =>
const response = await request(app).get('/api/branches');
expect(response.statusCode).toBe(200);
);
)
And package.json for test setting
"scripts":
"lint": "eslint .",
"start": "node .",
"posttest": "npm run lint",
"test": "jest --detectOpenHandles"
,
"jest":
"testEnvironment": "node"
Every time I run npm run test, the log always return:
Jest has detected the following 1 open handle potentially keeping Jest
from exiting:
● TCPWRAP
11 |
12 | test('It should response the GET method', async () => );
16 | })
at Test.Object..Test.serverAddress
(node_modules/supertest/lib/test.js:59:33)
at new Test (node_modules/supertest/lib/test.js:36:12)
at Object.obj.(anonymous function) [as get]
(node_modules/supertest/index.js:25:14)
at Object.get (test/unit/branch.test.js:13:45)
the log is pointing at get function. People in forum use jest --forceExit, but it is not the way I want. Are there any solutions for this problem? Thanks for the response
node.js testing jestjs loopbackjs supertest
I am trying to build a test using Jest and Supertest for my loopback 3 rest API server. The test is running, but Jest did not exit gracefully.
This is my test script branch.test.js:
const app = require('../server/server');
const request = require('supertest');
describe('Test the root path', () =>
afterAll(done =>
app.close(done);
);
test('It should response the GET method', async () =>
const response = await request(app).get('/api/branches');
expect(response.statusCode).toBe(200);
);
)
And package.json for test setting
"scripts":
"lint": "eslint .",
"start": "node .",
"posttest": "npm run lint",
"test": "jest --detectOpenHandles"
,
"jest":
"testEnvironment": "node"
Every time I run npm run test, the log always return:
Jest has detected the following 1 open handle potentially keeping Jest
from exiting:
● TCPWRAP
11 |
12 | test('It should response the GET method', async () => );
16 | })
at Test.Object..Test.serverAddress
(node_modules/supertest/lib/test.js:59:33)
at new Test (node_modules/supertest/lib/test.js:36:12)
at Object.obj.(anonymous function) [as get]
(node_modules/supertest/index.js:25:14)
at Object.get (test/unit/branch.test.js:13:45)
the log is pointing at get function. People in forum use jest --forceExit, but it is not the way I want. Are there any solutions for this problem? Thanks for the response
node.js testing jestjs loopbackjs supertest
node.js testing jestjs loopbackjs supertest
asked Mar 24 at 13:35
bublehbubleh
288311
288311
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55324359%2ftesting-loopback-3-with-jest-and-supertest-does-not-exit-gracefully%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55324359%2ftesting-loopback-3-with-jest-and-supertest-does-not-exit-gracefully%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown