-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcypress.config.ts
34 lines (30 loc) · 1.01 KB
/
cypress.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { defineConfig } from 'cypress';
import * as admin from 'firebase-admin';
import { plugin as cypressFirebasePlugin } from 'cypress-firebase';
admin.initializeApp({
projectId: 'testable-firebase-sample-chat-test',
});
export default defineConfig({
e2e: {
baseUrl: 'http://localhost:5000',
supportFile: 'cypress/support/e2e.ts',
setupNodeEvents(on, config) {
cypressFirebasePlugin(on, config, admin);
process.env.FIRESTORE_EMULATOR_HOST = 'localhost:8080';
process.env.FIREBASE_AUTH_EMULATOR_HOST = 'localhost:9099';
process.env.FIREBASE_STORAGE_EMULATOR_HOST = 'localhost:9199';
on('task', {
async 'create:user'(user: {
uid: string;
email: string;
displayName: string;
password: string;
emailVerified: boolean;
}) {
await admin.auth().createUser(user);
return admin.firestore().doc(`/users/${user.uid}`).set({ name: user.displayName, createdAt: new Date() });
},
});
},
},
});