BVB Source Codes

mongo-express Show databaseSpec.js Source code

Return Download mongo-express: download databaseSpec.js Source code - Download mongo-express Source code - Type:.js
  1. 'use strict';
  2.  
  3. const expect = require('chai').expect;
  4.  
  5. const httpUtils = require('../../testHttpUtils');
  6. const mongoUtils = require('../../testMongoUtils');
  7. const asPromise = require('../../testUtils').asPromise;
  8.  
  9. const dbName = mongoUtils.testDbName;
  10. const collectionName = mongoUtils.testCollectionName;
  11. const urlColName = mongoUtils.testURLCollectionName;
  12.  
  13. describe('Router database', () => {
  14.   let request;
  15.   let close;
  16.   let db;
  17.   before(() =>
  18.     mongoUtils.initializeDb()
  19.       .then((newDb) => {
  20.         db = newDb;
  21.         return httpUtils.createServer();
  22.       }).then((server) => {
  23.         request = server.request;
  24.         close = server.close;
  25.       })
  26.   );
  27.  
  28.   it('GET /db/<dbName> should return html', () =>
  29.     asPromise(cb => request.get(`/db/${dbName}`).expect(200).end(cb))
  30.       .then((res) => {
  31.         expect(res.text).to.match(new RegExp(`<title>${dbName} - Mongo Express</title>`));
  32.         expect(res.text).to.match(new RegExp(`<a href="/db/${dbName}/${urlColName}">${collectionName}</a>`));
  33.       })
  34.   );
  35.  
  36.   it('POST / should add a new db');
  37.   it('DEL /<dbName> should delete the db');
  38.  
  39.   after(() => Promise.all([
  40.     mongoUtils.cleanAndCloseDb(db),
  41.     close(),
  42.   ]));
  43. });
  44.  
  45.  
downloaddatabaseSpec.js Source code - Download mongo-express Source code
Related Source Codes/Software:
XCL-Charts - Android charting libraries (XCL-Charts is a free c... 2017-05-17
scrollMonitor - A simple and fast API to monitor elements as you s... 2017-05-16
XCDYouTubeKit - YouTube video player for iOS, tvOS and macOS 2017-05-16
rails-erd - Generate Entity-Relationship Diagrams for Rails ap... 2017-05-16
np - A better `npm publish` 2017-05-16
kaminari - A Scope & Engine based, clean, powerful, custo... 2017-06-04
python-fire - Python Fire is a library for automatically generat... 2017-06-04
Dapper - Dapper - a simple object mapper for .Net 2017-06-05
pkg - Package your Node.js project into an executable ... 2017-06-05
packer - Packer is a tool for creating identical machine im... 2017-06-05
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top