Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/test/e2e/newNotebook.stest.ts
13388 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import * as path from 'path';
7
import { ssuite, stest } from '../base/stest';
8
import { fetchConversationScenarios, Scenario } from './scenarioLoader';
9
import { generateScenarioTestRunner } from './scenarioTest';
10
11
(function () {
12
ssuite.skip({ title: 'newNotebook', subtitle: 'e2e', location: 'panel' }, (inputPath) => { //@Yoyokrazy, refactor for tool - debt
13
14
const scenarioFolder = inputPath ?? path.join(__dirname, '..', 'test/scenarios/test-new-notebooks');
15
const scenarios: Scenario[] = fetchConversationScenarios(scenarioFolder);
16
17
for (const scenario of scenarios) {
18
stest({ description: scenario[0].question.replace('/newNotebook ', ''), language: 'python' },
19
generateScenarioTestRunner(
20
scenario,
21
(accessor, question, userVisibleAnswer, rawResponse, index, turn, commands) => {
22
// TODO@rebornix: test if response contains the outline for notebook in a code block
23
for (const command of commands) {
24
if (command.command === 'github.copilot.newNotebook') {
25
return Promise.resolve({ success: true, errorMessage: '' });
26
}
27
}
28
return Promise.resolve({ success: false, errorMessage: 'Fail to parse newNotebook response' });
29
}
30
));
31
}
32
});
33
})();
34
35