Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeAll(() => __awaiter(this, void 0, void 0, function* () {
logger.trace('---- Starting Auth e2e ----');
yield test_object_literals_constants_1.setupTestDataJwtTokens(nestjs_bff_config_1.NestjsBffConfig);
// console.log('Auth-testData', JSON.stringify(testData, null, 2));
const module = yield testing_1.Test.createTestingModule({
imports: [auth_e2e_module_1.AuthE2eModule],
}).compile();
app = module.createNestApplication();
yield app.init();
httpServer = app.getHttpServer();
}), 5 * 60 * 1000);
//
exports.setupAuth = (globalConfig, nestJsBffConfig) => __awaiter(this, void 0, void 0, function* () {
const logger = logging_shared_module_1.getLogger();
//
// Setup
//
const module = yield testing_1.Test.createTestingModule({
imports: [auth_e2e_module_1.AuthE2eModule],
}).compile();
const app = module.createNestApplication();
yield app.init();
const authenticationRepo = yield app.get(authentication_repo_1.AuthenticationRepo);
const organizationRepo = yield app.get(organization_repo_1.OrganizationRepo);
const userRepo = yield app.get(user_repo_1.UserRepo);
const accessPermissionsRepo = yield app.get(access_permissions_repo_1.AccessPermissionsRepo);
//
// Add Data
//
// OrgA
yield organizationRepo.create(test_object_literals_constants_1.testData.orgA.orgEntity, { skipAuthorization: true });
// OrgA Admin User
yield userRepo.create(test_object_literals_constants_1.testData.orgA.users.adminUser.userEntity, { skipAuthorization: true });
yield authenticationRepo.create(test_object_literals_constants_1.testData.orgA.users.adminUser.authenticationEntity, { skipAuthorization: true });