<commit_before>import * as assert from "assert";
import { fsPath } from "../../../src/utils";
import { PackageDep } from "../../../src/views/packages_view";
import { ensurePackageTreeNode, extApi, getPackages, myPackageThingFile } from "../../helpers";

describe("packages tree", () => {
	// We have tests that require external packages.
	before("get packages", () => getPackages());

	it("includes known packages at the top level", async () => {
		const topLevel = await extApi.packagesTreeProvider.getChildren(undefined);
		ensurePackageTreeNode(topLevel, PackageDep, "my_package");
		ensurePackageTreeNode(topLevel, PackageDep, "meta");
		ensurePackageTreeNode(topLevel, PackageDep, "test");
	});

	it("does not include own package", async () => {
		const topLevel = await extApi.packagesTreeProvider.getChildren(undefined);
		const self = topLevel.find((node) => node.label === "hello_world");
		assert.equal(self, undefined);
	});

	it("includes know folders from inside lib/", async () => {
		const topLevel = await extApi.packagesTreeProvider.getChildren(undefined);
		const myPackage = ensurePackageTreeNode(topLevel, PackageDep, "my_package");
		const myPackageLibContents = await extApi.packagesTreeProvider.getChildren(myPackage);
		const file = ensurePackageTreeNode(myPackageLibContents, PackageDep, "my_thing.dart");
		assert.equal(fsPath(file.resourceUri), fsPath(myPackageThingFile));
	});
});<commit_msg>Update tests for dependencies tree<commit_after>import * as assert from "assert";
import { fsPath } from "../../../src/utils";
import { PackageDepFile, PackageDepPackage } from "../../../src/views/packages_view";
import { ensurePackageTreeNode, extApi, getPackages, myPackageThingFile } from "../../helpers";

describe("packages tree", () => {
	// We have tests that require external packages.
	before("get packages", () => getPackages());

	it("includes known packages at the top level", () => {
		const topLevel = extApi.packagesTreeProvider.getChildren(undefined);
		ensurePackageTreeNode(topLevel, PackageDepPackage, "my_package");
		ensurePackageTreeNode(topLevel, PackageDepPackage, "meta");
		ensurePackageTreeNode(topLevel, PackageDepPackage, "test");
	});

	it("does not include own package", () => {
		const topLevel = extApi.packagesTreeProvider.getChildren(undefined);
		const self = topLevel.find((node) => node.label === "hello_world");
		assert.equal(self, undefined);
	});

	it("includes know folders from inside lib/", () => {
		const topLevel = extApi.packagesTreeProvider.getChildren(undefined);
		const myPackage = ensurePackageTreeNode(topLevel, PackageDepPackage, "my_package");
		const myPackageLibContents = extApi.packagesTreeProvider.getChildren(myPackage);
		const file = ensurePackageTreeNode(myPackageLibContents, PackageDepFile, "my_thing.dart");
		assert.equal(fsPath(file.resourceUri), fsPath(myPackageThingFile));
	});
});
{'fraction_non_alphanumeric': 0.1449930458970793, 'fraction_numerical': 0.0, 'mean_word_length': 5.801418439716312, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, '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': '6635573', 'n_tokens_mistral': 830, 'n_tokens_neox': 803, 'n_words': 192}