Skip to content

Commit

Permalink
Merge pull request #19 from zhumeisongsong/feature/add-test-to-subgra…
Browse files Browse the repository at this point in the history
…phsConfig

test: 🧪 test case of subgraphsConfig
  • Loading branch information
zhumeisongsong authored Nov 8, 2024
2 parents e3a6194 + c02b11e commit a0f4d3f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
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`,
});
});
});

0 comments on commit a0f4d3f

Please sign in to comment.