nodejs-quickstart-structure 1.1.8 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodejs-quickstart-structure",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "type": "module",
5
5
  "description": "A CLI to scaffold Node.js microservices with MVC or Clean Architecture",
6
6
  "main": "bin/index.js",
@@ -0,0 +1,14 @@
1
+ <% if (language === 'TypeScript') { %>import request from 'supertest';
2
+ import express from 'express';<% } else { %>const request = require('supertest');
3
+ const express = require('express');<% } %>
4
+
5
+ const app = express();
6
+ app.get('/health', (req, res) => res.json({ status: 'UP' }));
7
+
8
+ describe('Health Check', () => {
9
+ it('should return 200 OK', async () => {
10
+ const res = await request(app).get('/health');
11
+ expect(res.status).toBe(200);
12
+ expect(res.body).toEqual({ status: 'UP' });
13
+ });
14
+ });