node-express-realworld-example-app
node-express-realworld-example-app copied to clipboard
Some tests fail
Before npm run test
, I npm run mongo:start
and npm run dev
.
Conduit API Tests
❏ Auth
↳ Register
POST http://localhost:3000/api/users [422 Unprocessable Entity, 358B, 108ms]
1. Response contains "user" property
2. User has "email" property
3. User has "username" property
4. User has "token" property
↳ Login
POST http://localhost:3000/api/users/login [200 OK, 541B, 111ms]
✓ Response contains "user" property
✓ User has "email" property
✓ User has "username" property
✓ User has "token" property
↳ Login and Remember Token
POST http://localhost:3000/api/users/login [200 OK, 541B, 83ms]
✓ Response contains "user" property
✓ User has "email" property
✓ User has "username" property
✓ User has "token" property
✓ Environment variable "token" has been set
↳ Current User
GET http://localhost:3000/api/user [200 OK, 511B, 9ms]
✓ Response contains "user" property
✓ User has "email" property
✓ User has "username" property
✓ User has "token" property
↳ Update User
PUT http://localhost:3000/api/user [200 OK, 511B, 69ms]
✓ Response contains "user" property
✓ User has "email" property
✓ User has "username" property
✓ User has "token" property
❏ Articles with authentication
↳ Feed
GET http://localhost:3000/api/articles/feed [200 OK, 272B, 22ms]
✓ Response code is 200 OK
✓ Response contains "articles" property
✓ Response contains "articlesCount" property
✓ articlesCount is an integer
✓ articlesCount is 0 when feed is empty
↳ All Articles
GET http://localhost:3000/api/articles [200 OK, 272B, 11ms]
✓ Response code is 200 OK
✓ Response contains "articles" property
✓ Response contains "articlesCount" property
✓ articlesCount is an integer
✓ articlesCount is 0 when feed is empty
↳ All Articles with auth
GET http://localhost:3000/api/articles [200 OK, 272B, 12ms]
✓ Response code is 200 OK
✓ Response contains "articles" property
✓ Response contains "articlesCount" property
✓ articlesCount is an integer
✓ articlesCount is 0 when feed is empty
↳ Articles by Author
GET http://localhost:3000/api/articles?author=johnjacob [200 OK, 272B, 24ms]
✓ Response code is 200 OK
✓ Response contains "articles" property
✓ Response contains "articlesCount" property
✓ articlesCount is an integer
✓ articlesCount is 0 when feed is empty
↳ Articles by Author with auth
GET http://localhost:3000/api/articles?author=johnjacob [200 OK, 272B, 20ms]
✓ Response code is 200 OK
✓ Response contains "articles" property
✓ Response contains "articlesCount" property
✓ articlesCount is an integer
✓ articlesCount is 0 when feed is empty
↳ Articles Favorited by Username
GET http://localhost:3000/api/articles?favorited=jane [200 OK, 272B, 15ms]
✓ Response code is 200 OK
✓ Response contains "articles" property
✓ Response contains "articlesCount" property
✓ articlesCount is an integer
✓ articlesCount is 0 when feed is empty
↳ Articles Favorited by Username with auth
GET http://localhost:3000/api/articles?favorited=jane [200 OK, 272B, 23ms]
✓ Response code is 200 OK
✓ Response contains "articles" property
✓ Response contains "articlesCount" property
✓ articlesCount is an integer
✓ articlesCount is 0 when feed is empty
↳ Articles by Tag
GET http://localhost:3000/api/articles?tag=dragons [200 OK, 272B, 12ms]
✓ Response code is 200 OK
✓ Response contains "articles" property
✓ Response contains "articlesCount" property
✓ articlesCount is an integer
✓ articlesCount is 0 when feed is empty
↳ Create Article
POST http://localhost:3000/api/articles [200 OK, 686B, 20ms]
✓ Response contains "article" property
✓ Article has "title" property
✓ Article has "slug" property
✓ Article has "body" property
✓ Article has "createdAt" property
✓ Article's "createdAt" property is an ISO 8601 timestamp
✓ Article has "updatedAt" property
✓ Article's "updatedAt" property is an ISO 8601 timestamp
✓ Article has "description" property
✓ Article has "tagList" property
✓ Article's "tagList" property is an Array
✓ Article has "author" property
✓ Article has "favorited" property
✓ Article has "favoritesCount" property
✓ favoritesCount is an integer
↳ Single Article by slug
GET http://localhost:3000/api/articles/how-to-train-your-dragon-sfe5i1 [200 OK, 656B, 27ms]
✓ Response contains "article" property
✓ Article has "title" property
✓ Article has "slug" property
✓ Article has "body" property
✓ Article has "createdAt" property
✓ Article's "createdAt" property is an ISO 8601 timestamp
✓ Article has "updatedAt" property
✓ Article's "updatedAt" property is an ISO 8601 timestamp
✓ Article has "description" property
✓ Article has "tagList" property
✓ Article's "tagList" property is an Array
✓ Article has "author" property
✓ Article has "favorited" property
✓ Article has "favoritesCount" property
✓ favoritesCount is an integer
↳ Update Article
PUT http://localhost:3000/api/articles/how-to-train-your-dragon-sfe5i1 [200 OK, 655B, 30ms]
✓ Response contains "article" property
✓ Article has "title" property
✓ Article has "slug" property
✓ Article has "body" property
✓ Article has "createdAt" property
✓ Article's "createdAt" property is an ISO 8601 timestamp
✓ Article has "updatedAt" property
✓ Article's "updatedAt" property is an ISO 8601 timestamp
✓ Article has "description" property
✓ Article has "tagList" property
✓ Article's "tagList" property is an Array
✓ Article has "author" property
✓ Article has "favorited" property
✓ Article has "favoritesCount" property
✓ favoritesCount is an integer
↳ Favorite Article
POST http://localhost:3000/api/articles/how-to-train-your-dragon-sfe5i1/favorite [500 Internal Server Error, 724B, 29ms]
5. Response contains "article" property
6. Article has "title" property
7. Article has "slug" property
8. Article has "body" property
9. Article has "createdAt" property
10⠄ RangeError in test-script
↳ Unfavorite Article
DELETE http://localhost:3000/api/articles/how-to-train-your-dragon-sfe5i1/favorite [200 OK, 655B, 44ms]
✓ Response contains "article" property
✓ Article has "title" property
✓ Article has "slug" property
✓ Article has "body" property
✓ Article has "createdAt" property
✓ Article's "createdAt" property is an ISO 8601 timestamp
✓ Article has "updatedAt" property
✓ Article's "updatedAt" property is an ISO 8601 timestamp
✓ Article has "description" property
✓ Article has "tagList" property
✓ Article's "tagList" property is an Array
✓ Article has "author" property
✓ Article has "favorited" property
✓ Article has "favoritesCount" property
✓ favoritesCount is an integer
✓ Article's "favorited" property is true
❏ Articles
↳ All Articles
GET http://localhost:3000/api/articles [200 OK, 676B, 12ms]
✓ Response code is 200 OK
✓ Response contains "articles" property
✓ Response contains "articlesCount" property
✓ articlesCount is an integer
✓ Article has "title" property
✓ Article has "slug" property
✓ Article has "body" property
✓ Article has "createdAt" property
✓ Article's "createdAt" property is an ISO 8601 timestamp
✓ Article has "updatedAt" property
✓ Article's "updatedAt" property is an ISO 8601 timestamp
✓ Article has "description" property
✓ Article has "tagList" property
✓ Article's "tagList" property is an Array
✓ Article has "author" property
✓ Article has "favorited" property
✓ Article has "favoritesCount" property
✓ favoritesCount is an integer
↳ Articles by Author
GET http://localhost:3000/api/articles?author=johnjacob [200 OK, 676B, 19ms]
✓ Response code is 200 OK
✓ Response contains "articles" property
✓ Response contains "articlesCount" property
✓ articlesCount is an integer
✓ Article has "title" property
✓ Article has "slug" property
✓ Article has "body" property
✓ Article has "createdAt" property
✓ Article's "createdAt" property is an ISO 8601 timestamp
✓ Article has "updatedAt" property
✓ Article's "updatedAt" property is an ISO 8601 timestamp
✓ Article has "description" property
✓ Article has "tagList" property
✓ Article's "tagList" property is an Array
✓ Article has "author" property
✓ Article has "favorited" property
✓ Article has "favoritesCount" property
✓ favoritesCount is an integer
↳ Articles Favorited by Username
GET http://localhost:3000/api/articles?favorited=jane [200 OK, 272B, 15ms]
✓ Response code is 200 OK
✓ Response contains "articles" property
✓ Response contains "articlesCount" property
✓ articlesCount is an integer
✓ articlesCount is 0 when feed is empty
↳ Articles by Tag
GET http://localhost:3000/api/articles?tag=dragons [200 OK, 676B, 12ms]
✓ Response code is 200 OK
✓ Response contains "articles" property
✓ Response contains "articlesCount" property
✓ articlesCount is an integer
✓ Article has "title" property
✓ Article has "slug" property
✓ Article has "body" property
✓ Article has "createdAt" property
✓ Article's "createdAt" property is an ISO 8601 timestamp
✓ Article has "updatedAt" property
✓ Article's "updatedAt" property is an ISO 8601 timestamp
✓ Article has "description" property
✓ Article has "tagList" property
✓ Article's "tagList" property is an Array
✓ Article has "author" property
✓ Article has "favorited" property
✓ Article has "favoritesCount" property
✓ favoritesCount is an integer
↳ Single Article by slug
GET http://localhost:3000/api/articles/how-to-train-your-dragon-sfe5i1 [200 OK, 655B, 13ms]
✓ Response contains "article" property
✓ Article has "title" property
✓ Article has "slug" property
✓ Article has "body" property
✓ Article has "createdAt" property
✓ Article's "createdAt" property is an ISO 8601 timestamp
✓ Article has "updatedAt" property
✓ Article's "updatedAt" property is an ISO 8601 timestamp
✓ Article has "description" property
✓ Article has "tagList" property
✓ Article's "tagList" property is an Array
✓ Article has "author" property
✓ Article has "favorited" property
✓ Article has "favoritesCount" property
✓ favoritesCount is an integer
❏ Comments
↳ All Comments for Article
GET http://localhost:3000/api/articles/how-to-train-your-dragon-sfe5i1/comments [200 OK, 253B, 17ms]
✓ Response code is 200 OK
✓ Response contains "comments" property
↳ Create Comment for Article
POST http://localhost:3000/api/articles/how-to-train-your-dragon-sfe5i1/comments [500 Internal Server Error, 724B, 32ms]
11. Response contains "comment" property
12. Comment has "id" property
13. Comment has "body" property
14. Comment has "createdAt" property
15⠄ RangeError in test-script
↳ Delete Comment for Article
DELETE http://localhost:3000/api/articles/how-to-train-your-dragon-sfe5i1/comments/1 [500 Internal Server Error, 479B, 13ms]
❏ Profiles
↳ Profile
GET http://localhost:3000/api/profiles/johnjacob [200 OK, 362B, 13ms]
✓ Response code is 200 OK
✓ Response contains "profile" property
✓ Profile has "username" property
✓ Profile has "image" property
✓ Profile has "following" property
↳ Follow Profile
POST http://localhost:3000/api/profiles/johnjacob/follow [500 Internal Server Error, 724B, 40ms]
16. Response code is 200 OK
↳ Unfollow Profile
DELETE http://localhost:3000/api/profiles/johnjacob/follow [200 OK, 362B, 19ms]
✓ Response code is 200 OK
✓ Response contains "profile" property
✓ Profile has "username" property
✓ Profile has "image" property
✓ Profile has "following" property
✓ Profile's "following" property is false
❏ Tags
↳ All Tags
GET http://localhost:3000/api/tags [200 OK, 270B, 9ms]
✓ Response code is 200 OK
✓ Response contains "tags" property
✓ "tags" property returned as array
❏ Cleanup
↳ Delete Article
DELETE http://localhost:3000/api/articles/how-to-train-your-dragon-sfe5i1 [204 No Content, 179B, 35ms]
┌─────────────────────────┬──────────┬──────────┐
│ │ executed │ failed │
├─────────────────────────┼──────────┼──────────┤
│ iterations │ 1 │ 0 │
├─────────────────────────┼──────────┼──────────┤
│ requests │ 31 │ 0 │
├─────────────────────────┼──────────┼──────────┤
│ test-scripts │ 29 │ 2 │
├─────────────────────────┼──────────┼──────────┤
│ prerequest-scripts │ 0 │ 0 │
├─────────────────────────┼──────────┼──────────┤
│ assertions │ 222 │ 14 │
├─────────────────────────┴──────────┴──────────┤
│ total run duration: 1780ms │
├───────────────────────────────────────────────┤
│ total data received: 6.48KB (approx) │
├───────────────────────────────────────────────┤
│ average response time: 29ms │
└───────────────────────────────────────────────┘
# failure detail
01. AssertionError Response contains "user" property
expected false to be truthy
at assertion:0 in test-script
inside "Auth / Register"
02. AssertionError User has "email" property
expected false to be truthy
at assertion:1 in test-script
inside "Auth / Register"
03. AssertionError User has "username" property
expected false to be truthy
at assertion:2 in test-script
inside "Auth / Register"
04. AssertionError User has "token" property
expected false to be truthy
at assertion:3 in test-script
inside "Auth / Register"
05. AssertionError Response contains "article" property
expected false to be truthy
at assertion:0 in test-script
inside "Articles with authentication / Favorite Article"
06. AssertionError Article has "title" property
expected false to be truthy
at assertion:1 in test-script
inside "Articles with authentication / Favorite Article"
07. AssertionError Article has "slug" property
expected false to be truthy
at assertion:2 in test-script
inside "Articles with authentication / Favorite Article"
08. AssertionError Article has "body" property
expected false to be truthy
at assertion:3 in test-script
inside "Articles with authentication / Favorite Article"
09. AssertionError Article has "createdAt" property
expected false to be truthy
at assertion:4 in test-script
inside "Articles with authentication / Favorite Article"
10. RangeError
Invalid time value
at test-script
inside "Articles with authentication / Favorite Article"
11. AssertionError Response contains "comment" property
expected false to be truthy
at assertion:0 in test-script
inside "Comments / Create Comment for Article"
12. AssertionError Comment has "id" property
expected false to be truthy
at assertion:1 in test-script
inside "Comments / Create Comment for Article"
13. AssertionError Comment has "body" property
expected false to be truthy
at assertion:2 in test-script
inside "Comments / Create Comment for Article"
14. AssertionError Comment has "createdAt" property
expected false to be truthy
at assertion:3 in test-script
inside "Comments / Create Comment for Article"
15. RangeError
Invalid time value
at test-script
inside "Comments / Create Comment for Article"
16. AssertionError Response code is 200 OK
expected false to be truthy
at assertion:0 in test-script
inside "Profiles / Follow Profile"
I got exactly the same results on Mac Big Sur, tried node v10.24.1, v12.22.1 and v14.16.1.