greysonmrx / foodhut Goto Github PK
View Code? Open in Web Editor NEWA food delivery system
A food delivery system
When running the tests, an error occurs because it does not pass the user name on the request body.
Tests are not passing because jest is not reading environment variables.
25 | return res.status(200).json({
26 | user: { id, name, email },
> 27 | token: jwt.sign({ id }, process.env.APP_SECRET, {
| ^
28 | expiresIn: process.env.EXPIRES_IN,
29 | }),
30 | });
When accessing the /users
route using the HTTP method delete passing a non-existent user, an error is returned.
Invalid tests are passing when executing the command yarn test
.
When using Supertest, if a test file contains only one interface test, the following error will be reported. If two interface tests are added, no error will be reported. May be related to some asynchronous actions of the MySQL2 package.
ReferenceError: You are trying to import
a file after the Jest environment has been torn down.
at Object.getCodec (node_modules/mysql2/node_modules/iconv-lite/lib/index.js:65:27)
at Object.getDecoder (node_modules/mysql2/node_modules/iconv-lite/lib/index.js:127:23)
at Object.exports.decode (node_modules/mysql2/lib/parsers/string.js:10:25)
at Packet.readNullTerminatedString (node_modules/mysql2/lib/packets/packet.js:398:25)
at Function.fromPacket (node_modules/mysql2/lib/packets/handshake.js:62:33)
Encoding not recognized: 'cesu8' (searched as: 'cesu8')
at Object.getCodec (node_modules/mysql2/node_modules/iconv-lite/lib/index.js:106:23)
at Object.getDecoder (node_modules/mysql2/node_modules/iconv-lite/lib/index.js:127:23)
at Object.exports.decode (node_modules/mysql2/lib/parsers/string.js:10:25)
at Packet.readNullTerminatedString (node_modules/mysql2/lib/packets/packet.js:398:25)
at Function.fromPacket (node_modules/mysql2/lib/packets/handshake.js:62:33)
at PacketParser.executeStart (node_modules/mysql2/lib/packet_parser.js:75:16)
at Socket.<anonymous> (node_modules/mysql2/lib/connection.js:82:25)
When you run the tests, the .env file is loaded instead of the .env.test file.
The business rule of not registering a product with the same name does not apply when updating a product, causing two products to have the same name
When running the command yarn test
, no migrations were executed and the tests fail.
VSCode Intellisense is not suggesting available methods in Jest. I expect VSCode intellisense would assist me with available methods from JEST.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.