MCPcopy
hub / github.com/strongloop/loopback / seedServerData

Function seedServerData

test/replication.rest.test.js:568–618  ·  view source on GitHub ↗
(done)

Source from the content-addressed store, hash-verified

566 }
567
568 function seedServerData(done) {
569 async.series([
570 function(next) {
571 serverApp.dataSources.db.automigrate(next);
572 },
573 function(next) {
574 ServerUser.create([ALICE, PETER, EMERY], function(err, created) {
575 if (err) return next(err);
576
577 aliceId = created[0].id;
578 peterId = created[1].id;
579
580 next();
581 });
582 },
583 function(next) {
584 ServerUser.login(ALICE, function(err, token) {
585 if (err) return next(err);
586
587 aliceToken = token.id;
588
589 ServerUser.login(PETER, function(err, token) {
590 if (err) return next(err);
591
592 peterToken = token.id;
593
594 ServerUser.login(EMERY, function(err, token) {
595 emeryToken = token.id;
596
597 next();
598 });
599 });
600 });
601 },
602 function(next) {
603 ServerCar.create(
604 [
605 {id: 'Ford-Mustang', maker: 'Ford', model: 'Mustang'},
606 {id: 'Audi-R8', maker: 'Audi', model: 'R8'},
607 ],
608 function(err, cars) {
609 if (err) return next(err);
610
611 serverCars = cars.map(carToString);
612
613 next();
614 },
615 );
616 },
617 ], done);
618 }
619
620 function seedClientData(done) {
621 async.series([

Callers

nothing calls this directly

Calls 1

nextFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…