<commit_before>"use strict";

// 
// note: This test is leveraging the Mocha test framework.
// please refer to their documentation on https://mochajs.org/ for help.
//

// the module 'assert' provides assertion methods from node
import * as assert from "assert"; 

import * as vscode from "vscode";

import * as mockfs from "mock-fs";

import "should";

// you can import and use all API from the 'vscode' module
// as well as import your extension to test it
import NugetManager from "../src/nugetManager";

import * as ThenableAssert from "./ThenableAssert";

suite("Nuget4Code endpoints-related tests", () => {

	test("getQueryUri is consuming the endoint", () => {
		// arrange
		var nugetManager: NugetManager = new NugetManager(false);
		var nugetManagerPrivate: any = nugetManager;

		nugetManagerPrivate.queryEndpoint = "htts://example:4242/";

		// act
		var value: Object = nugetManagerPrivate.getQueryUri("random");

		// assert
		value.should.startWith(nugetManagerPrivate.queryEndpoint);
		value.should.containEql("random");
	});

	test("queryPackage is working without internet", (done: MochaDone) => {
		// arrange
		var nugetManager: NugetManager = new NugetManager(false);
		var nugetManagerPrivate: any = nugetManager;

		nugetManagerPrivate.queryEndpoint = "htts://example:4242/";
		nugetManagerPrivate.endPointsInitialization = Promise.reject("unit rest");
		nugetManagerPrivate.getJsonResponse = () => { throw "should not be called"; };

		// act
		var thenable = nugetManager.queryPackage("random");

		// assert
		ThenableAssert.shouldBeResolved(thenable, done,
			(packages: INugetPackageInfo[] ) =>  { packages.length.should.be.equal(0); });
	});
});<commit_msg>test failing - 2<commit_after>"use strict";

// 
// note: This test is leveraging the Mocha test framework.
// please refer to their documentation on https://mochajs.org/ for help.
//

// the module 'assert' provides assertion methods from node
import * as assert from "assert"; 

import * as vscode from "vscode";

import * as mockfs from "mock-fs";

import "should";

// you can import and use all API from the 'vscode' module
// as well as import your extension to test it
import NugetManager from "../src/nugetManager";

import * as ThenableAssert from "./ThenableAssert";

suite("Nuget4Code endpoints-related tests", () => {

	test("getQueryUri is consuming the endoint", () => {
		// arrange
		var nugetManager: NugetManager = new NugetManager(false);
		var nugetManagerPrivate: any = nugetManager;

		nugetManagerPrivate.queryEndpoint = "htts://example:4242/";

		// act
		var value: Object = nugetManagerPrivate.getQueryUri("random");

		// assert
		value.should.startWith(nugetManagerPrivate.queryEndpoint);
		value.should.containEql("random");
	});

	test("queryPackage is working without internet", (done: MochaDone) => {
		// arrange
		var nugetManager: NugetManager = new NugetManager(false);
		var nugetManagerPrivate: any = nugetManager;

		nugetManagerPrivate.queryEndpoint = "htts://example:4242/";
		nugetManagerPrivate.endPointsInitialization = Promise.reject("unit rest");
		nugetManagerPrivate.getJsonResponse = () => { throw "should not be called"; };

		// act
		var thenable = nugetManager.queryPackage("random");

		// assert
		ThenableAssert.shouldBeResolved(thenable, done,
			(packages: INugetPackageInfo[] ) =>  { packages.length.should.be.equal(1); });
	});
});
{'fraction_non_alphanumeric': 0.1287363125184966, 'fraction_numerical': 0.006214856466410181, 'mean_word_length': 4.373608903020668, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '230801', 'n_tokens_mistral': 1083, 'n_tokens_neox': 1001, 'n_words': 282}