5 /* This scripts generates test users and rooms to be used if developer hasn't configured OAuth */
7 // default log level is error
8 // can be changed with `env "logging:level=info" ./scripts/utils/<name of this script>.js`
9 process.env['logging:level'] = process.env['logging:level'] || 'error';
11 const fixtureLoader = require('gitter-web-test-utils/lib/test-fixtures');
12 const shutdown = require('shutdown');
13 const env = require('gitter-web-env');
14 const config = env.config;
16 require('../../server/event-listeners').install();
18 const createdFixtures = {};
21 .manual(createdFixtures, {
23 accessToken: 'web-internal'
26 accessToken: 'web-internal'
32 extraAdmins: ['user1']
37 const { user1, user2, troupe1 } = createdFixtures;
38 const basepath = config.get('web:basepath');
40 console.log('========================');
41 console.log("You've successfully created seed data\n");
42 console.log(`There is now a public room ${basepath}/${troupe1.uri}\n`);
43 console.log(`And there are two users:\n`);
45 `User A (${user1.username}) is an admin of the room\n - you can log in by going to ${basepath}/?access_token=${user1.accessToken}`
48 `User B (${user2.username}) is not a member of the room\n - you can log in by going to ${basepath}/?access_token=${user2.accessToken}`
50 console.log('========================');
52 shutdown.shutdownGracefully(0);
56 shutdown.shutdownGracefully(1);