Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: 🧪 test case of subgraphsConfig #19

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions libs/application-config/src/lib/applications-config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ describe('Service Configurations', () => {
} = require('./applications-config');

expect(gatewayConfig).toEqual({
host: 'localhost',
host: 'http://localhost',
name: 'gateway',
port: '3333',
});

expect(userSubGraph).toEqual({
host: 'localhost',
host: 'http://localhost',
name: 'user',
port: '15001',
});

expect(taskSubGraph).toEqual({
host: 'localhost',
host: 'http://localhost',
name: 'task',
port: '15002',
});
Expand Down
2 changes: 1 addition & 1 deletion libs/application-config/src/lib/applications-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ interface ApplicationConfig {
name: string;
}

const DEFAULT_HOST = 'localhost';
const DEFAULT_HOST = 'http://localhost';

const DEFAULT_PORT = {
user: '15001',
Expand Down
12 changes: 12 additions & 0 deletions libs/application-config/src/lib/subgraphs-config.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { subgraphsConfig } from './subgraphs-config';
import { userSubGraph } from './applications-config';

describe('subgraphsConfig', () => {
it('should have the correct configuration for the user subgraph', () => {
expect(subgraphsConfig).toHaveLength(1);
expect(subgraphsConfig[0]).toEqual({
name: userSubGraph.name,
url: `${userSubGraph.host}:${userSubGraph.port}/graphql`,
});
});
});