Skip to content

Commit 7acb748

Browse files
committed
Changed integration test
1 parent 3902ee1 commit 7acb748

File tree

4 files changed

+5
-87
lines changed

4 files changed

+5
-87
lines changed

test/TestCases/Case09/Case09.02.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const testCase = readJSONFile('./test/TestCases/Case09/apollo-subgraph.json');
66
const testDbInfo = parseNeptuneEndpoint(testCase.host + ':' + testCase.port);
77

88
const outputFolderPath = './test/TestCases/Case09/apollo-subgraph-output';
9-
const outputReferencePath = './test/TestCases/Case09/outputReference';
109
describe('Validate Apollo Server Subgraph output artifacts', () => {
1110
afterAll(() => {
1211
fs.rmSync(outputFolderPath, {recursive: true});
@@ -20,5 +19,5 @@ describe('Validate Apollo Server Subgraph output artifacts', () => {
2019
`${testDbInfo.graphName}.source.schema.graphql`
2120
]);
2221

23-
testApolloArtifacts(outputFolderPath, outputReferencePath, testDbInfo, true);
22+
testApolloArtifacts(outputFolderPath, testDbInfo, true);
2423
});

test/TestCases/Case09/Case09.04.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ import {parseNeptuneEndpoint} from "../../../src/util.js";
55
const testCase = readJSONFile('./test/TestCases/Case09/apollo-subgraph-input-schema.json');
66
const testDbInfo = parseNeptuneEndpoint(testCase.host + ':' + testCase.port);
77
const outputFolderPath = './test/TestCases/Case09/apollo-subgraph-input-schema-output';
8-
const outputReferencePath = './test/TestCases/Case09/outputReference';
98

109
describe('Validate Apollo Server Subgraph output artifacts are created when using an input schema file', () => {
1110
afterAll(async () => {
1211
fs.rmSync(outputFolderPath, {recursive: true});
1312
});
1413

15-
testApolloArtifacts(outputFolderPath, outputReferencePath, testDbInfo, true);
14+
testApolloArtifacts(outputFolderPath, testDbInfo, true);
1615
});

test/TestCases/Case09/outputReference/index.mjs

Lines changed: 0 additions & 78 deletions
This file was deleted.

test/testLib.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ async function testResolverQueriesResults(resolverFile, queriesReferenceFolder,
185185
* Validates that an apollo zip contains the correct content.
186186
*
187187
* @param {string} outputFolderPath the test output folder path that contains the apollo zip file to validate
188-
* @param outputReferencePath the test output reference folder path that contains apollo files for content validation
189188
* @param {object} testDbInfo object that contains info about the neptune db/graph used to generate the apollo zip file
190189
* @param {string} testDbInfo.graphName neptune db/graph name
191190
* @param {string} testDbInfo.neptuneType neptune-db or neptune-graph
@@ -195,7 +194,7 @@ async function testResolverQueriesResults(resolverFile, queriesReferenceFolder,
195194
* @param {boolean} subgraph true if the apollo zip contents should be for a subgraph
196195
* @returns {Promise<void>}
197196
*/
198-
async function testApolloArtifacts(outputFolderPath, outputReferencePath, testDbInfo, subgraph = false) {
197+
async function testApolloArtifacts(outputFolderPath, testDbInfo, subgraph = false) {
199198
test('Validate Apollo zip contents', () => {
200199
const expectedFiles = [
201200
'.env',
@@ -228,9 +227,8 @@ async function testApolloArtifacts(outputFolderPath, outputReferencePath, testDb
228227
const actualEnvContent = fs.readFileSync(path.join(outputFolderPath, 'unzipped', '.env'), 'utf8');
229228
expect(actualEnvContent).toEqual(expectedEnvContent.join('\n'));
230229

231-
const expectedIndexFileContent = fs.readFileSync(path.join(outputReferencePath, 'index.mjs'), 'utf8');
232-
const actualIndexFileContent = fs.readFileSync(path.join(outputFolderPath, 'unzipped', 'index.mjs'), 'utf8');
233-
expect(actualIndexFileContent).toEqual(expectedIndexFileContent);
230+
const actualIndexContent = fs.readFileSync(path.join(outputFolderPath, 'unzipped', 'index.mjs'), 'utf8');
231+
expect(actualIndexContent).toContain('https://specs.apollo.dev/federation/v2.0');
234232
});
235233
}
236234

0 commit comments

Comments
 (0)