Skip to content

Commit

Permalink
Ajustes de los test del modelo usuario
Browse files Browse the repository at this point in the history
  • Loading branch information
kerkox committed Jan 13, 2021
1 parent 010ae6f commit 248e00a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 8 deletions.
12 changes: 12 additions & 0 deletions newrelic_agent.log
Original file line number Diff line number Diff line change
Expand Up @@ -656,3 +656,15 @@
{"v":0,"level":30,"name":"newrelic","hostname":"PAUL-LENOVO","pid":16358,"time":"2021-01-13T21:17:01.077Z","msg":"Valid event_harvest_config received. Updating harvest cycles. {\"report_period_ms\":5000,\"harvest_limits\":{\"error_event_data\":8,\"analytic_event_data\":833,\"custom_event_data\":83}}"}
{"v":0,"level":30,"name":"newrelic","hostname":"PAUL-LENOVO","pid":16358,"time":"2021-01-13T21:17:01.079Z","msg":"Agent state changed from connected to started."}
{"v":0,"level":30,"name":"newrelic","hostname":"PAUL-LENOVO","pid":16358,"time":"2021-01-13T21:17:02.079Z","msg":"Starting initial 1000ms harvest."}
{"v":0,"level":30,"name":"newrelic","hostname":"PAUL-LENOVO","pid":16836,"time":"2021-01-13T21:18:34.517Z","msg":"Using New Relic for Node.js. Agent version: 6.12.0; Node version: v14.15.4."}
{"v":0,"level":40,"name":"newrelic","hostname":"PAUL-LENOVO","pid":16836,"time":"2021-01-13T21:18:34.609Z","msg":"The newrelic module must be the first module required.\nThe following modules were required before newrelic and are not being instrumented:\n\tmongodb: /home/paul/projects/node/red_bicicletas/node_modules/mongodb/index.js\n\tbluebird: /home/paul/projects/node/red_bicicletas/node_modules/bluebird/js/release/bluebird.js"}
{"v":0,"level":30,"name":"newrelic","hostname":"PAUL-LENOVO","pid":16836,"time":"2021-01-13T21:18:34.609Z","msg":"Agent state changed from stopped to starting."}
{"v":0,"level":30,"name":"newrelic","hostname":"PAUL-LENOVO","pid":16836,"time":"2021-01-13T21:18:34.691Z","msg":"Starting New Relic for Node.js connection process."}
{"v":0,"level":30,"name":"newrelic","hostname":"PAUL-LENOVO","pid":16836,"time":"2021-01-13T21:18:34.691Z","msg":"Agent state changed from starting to connecting."}
{"v":0,"level":40,"name":"newrelic","hostname":"PAUL-LENOVO","pid":16836,"time":"2021-01-13T21:18:36.396Z","msg":"Unable to retrieve cached path for one or more modules with an already loaded parent. Forcing resolution. This should not occur during normal agent execution. Module resolution performance my be impacted. See trace-level logs for specific modules.","component":"shimmer"}
{"v":0,"level":30,"name":"newrelic","hostname":"PAUL-LENOVO","pid":16836,"time":"2021-01-13T21:18:36.980Z","msg":"Agent state changed from connecting to connected."}
{"v":0,"level":30,"name":"newrelic","hostname":"PAUL-LENOVO","pid":16836,"time":"2021-01-13T21:18:36.981Z","msg":"Connected to collector-003.newrelic.com:443 with agent run ID BckGZnWABxWwACtCOTDJZxtf_2QAAAgBAAAnIQEAAEHEAgQl7KHvAwAGNi4xMi4wAAtQQVVMLUxFTk9WTwAOUmVkLUJpY2ljbGV0YXM.","component":"collector_api"}
{"v":0,"level":30,"name":"newrelic","hostname":"PAUL-LENOVO","pid":16836,"time":"2021-01-13T21:18:36.981Z","msg":"Reporting to: https://rpm.newrelic.com/accounts/2835001/applications/636264943","component":"collector_api"}
{"v":0,"level":30,"name":"newrelic","hostname":"PAUL-LENOVO","pid":16836,"time":"2021-01-13T21:18:36.982Z","msg":"Valid event_harvest_config received. Updating harvest cycles. {\"report_period_ms\":5000,\"harvest_limits\":{\"error_event_data\":8,\"analytic_event_data\":833,\"custom_event_data\":83}}"}
{"v":0,"level":30,"name":"newrelic","hostname":"PAUL-LENOVO","pid":16836,"time":"2021-01-13T21:18:36.985Z","msg":"Agent state changed from connected to started."}
{"v":0,"level":30,"name":"newrelic","hostname":"PAUL-LENOVO","pid":16836,"time":"2021-01-13T21:18:37.986Z","msg":"Starting initial 1000ms harvest."}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require('dotenv').config();
var mongoose = require('mongoose')
var Bicicleta = require('../../models/bicicleta')
var Reserva = require('../../models/reserva');
Expand All @@ -6,20 +7,32 @@ var Usuario = require('../../models/usuario');


describe('Testing Usuarios', function () {
beforeEach(function (done) {
// var mongoDB = 'mongodb://localhost/testdb'
var mongoDB = 'mongodb+srv://strider:[email protected]/testdb';
let db;
conectar = (done) => {
var mongoDB = process.env.MONGO_URI;
console.log("mongoDB: ", mongoDB)
mongoose.connect(mongoDB, {
useNewUrlParser: true,
useUnifiedTopology: true
useUnifiedTopology: true,
useCreateIndex: true,
useFindAndModify: false
})

const db = mongoose.connection
db.on('error', console.error.bind(console, 'connection error'))
db = mongoose.connection;
db.on('error', console.error.bind(console, 'connection error'));
db.once('open', function () {
console.log('We are connected to test database')
done()
console.log('We are connected to test database!');
done();
})
}
beforeAll(function (done) {
// var mongoDB = 'mongodb://localhost/testdb'
if (mongoose.connection.readyState) {
db = mongoose.connection;
done();
} else {
conectar(done);
}
})

afterEach(function (done) {
Expand Down

0 comments on commit 248e00a

Please sign in to comment.