Skip to content

Commit

Permalink
Spelling correction
Browse files Browse the repository at this point in the history
  • Loading branch information
DaanV2 committed Nov 9, 2023
1 parent 0920522 commit ac9175a
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 43 deletions.
6 changes: 3 additions & 3 deletions src/Lib/mcdefinitions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as fs from "fs";

/**A single defintion for MCDefinitions*/
/**A single definition for MCDefinitions*/
export interface Definition {
/**The definition that have been defined*/
defined: string[];
Expand Down Expand Up @@ -52,7 +52,7 @@ export namespace Definition {
};
}

/** Checks if the given object implements the Defintion interface
/** Checks if the given object implements the definition interface
* @param value The object to inspect
* @returns Whether or not the object implements Definition*/
export function is(value: any): value is Definition {
Expand All @@ -76,7 +76,7 @@ export interface MCDefinition {

/**The namespace that provides functions for the MCDefinition interface*/
export namespace MCDefinition {
/**The default filename of MCDefintions*/
/**The default filename of MCdefinitions*/
export const filename = ".mcdefinitions";

/**Converts the given contents as if its file contents and returns a MCDefinition object
Expand Down
4 changes: 2 additions & 2 deletions src/Lib/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export namespace MCProject {
return false;
}

/**Loads from the given root folder the nesscary project files
/**Loads from the given root folder the necessary project files
* @param Source The root folder to retrieve files from
* @returns*/
export function loadSync(Source: string): MCProject {
Expand All @@ -55,7 +55,7 @@ export namespace MCProject {
};
}

/**Loads from the given root folder the nesscary project files
/**Loads from the given root folder the necessary project files
* @param Source The root folder to retrieve files from*/
export function load(Source: string): Promise<MCProject> {
return new Promise((resolve, reject) => {
Expand Down
76 changes: 38 additions & 38 deletions test/mcdefinitions/parse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,64 +20,64 @@ describe("MCDefinition", () => {
it("loadSync file1", () => {
const filepath = path.join(TestFilesFolder, "mcdefinitions", "file1.mcdefinitions");

let Defintions = MCDefinition.loadSync(filepath);
const definitions = MCDefinition.loadSync(filepath);

//Tags
expect(Defintions.tag.defined.includes("tag_number1")).to.be.true;
expect(Defintions.tag.excluded.includes("FoLolOl")).to.be.true;
expect(Defintions.tag.defined.length).to.equal(1);
expect(Defintions.tag.excluded.length).to.equal(1);
expect(definitions.tag.defined.includes("tag_number1")).to.be.true;
expect(definitions.tag.excluded.includes("FoLolOl")).to.be.true;
expect(definitions.tag.defined.length).to.equal(1);
expect(definitions.tag.excluded.length).to.equal(1);

//Families
expect(Defintions.family.defined.includes("npc")).to.be.true;
expect(Defintions.family.defined.includes("Npc")).to.be.true;
expect(Defintions.family.excluded.includes("nemesis")).to.be.true;
expect(Defintions.family.defined.includes("enemy")).to.be.true;
expect(Defintions.family.defined.length).to.equal(3);
expect(Defintions.family.excluded.length).to.equal(1);
expect(definitions.family.defined.includes("npc")).to.be.true;
expect(definitions.family.defined.includes("Npc")).to.be.true;
expect(definitions.family.excluded.includes("nemesis")).to.be.true;
expect(definitions.family.defined.includes("enemy")).to.be.true;
expect(definitions.family.defined.length).to.equal(3);
expect(definitions.family.excluded.length).to.equal(1);

//Objectives
expect(Defintions.objective.defined.includes("counter")).to.be.true;
expect(Defintions.objective.excluded.includes("Foo")).to.be.true;
expect(Defintions.objective.defined.length).to.equal(1);
expect(Defintions.objective.excluded.length).to.equal(1);
expect(definitions.objective.defined.includes("counter")).to.be.true;
expect(definitions.objective.excluded.includes("Foo")).to.be.true;
expect(definitions.objective.defined.length).to.equal(1);
expect(definitions.objective.excluded.length).to.equal(1);

//Names
expect(Defintions.name.defined.includes("Steve")).to.be.true;
expect(Defintions.name.excluded.includes("Creeper")).to.be.true;
expect(Defintions.name.defined.length).to.equal(1);
expect(Defintions.name.excluded.length).to.equal(1);
expect(definitions.name.defined.includes("Steve")).to.be.true;
expect(definitions.name.excluded.includes("Creeper")).to.be.true;
expect(definitions.name.defined.length).to.equal(1);
expect(definitions.name.excluded.length).to.equal(1);
});

it("load file2", (done) => {
const filepath = path.join(TestFilesFolder, "mcdefinitions", "file2.mcdefinitions");

MCDefinition.load(filepath).then((Defintions) => {
MCDefinition.load(filepath).then((definitions) => {
//Tags
expect(Defintions.tag.defined.includes("tag_number1"));
expect(Defintions.tag.excluded.includes("FoLolOl"));
expect(Defintions.tag.defined.length).to.equal(1);
expect(Defintions.tag.excluded.length).to.equal(1);
expect(definitions.tag.defined.includes("tag_number1"));
expect(definitions.tag.excluded.includes("FoLolOl"));
expect(definitions.tag.defined.length).to.equal(1);
expect(definitions.tag.excluded.length).to.equal(1);

//Families
expect(Defintions.family.defined.includes("npc"));
expect(Defintions.family.defined.includes("Npc"));
expect(Defintions.family.excluded.includes("nemesis"));
expect(Defintions.family.defined.includes("enemy"));
expect(Defintions.family.defined.length).to.equal(3);
expect(Defintions.family.excluded.length).to.equal(1);
expect(definitions.family.defined.includes("npc"));
expect(definitions.family.defined.includes("Npc"));
expect(definitions.family.excluded.includes("nemesis"));
expect(definitions.family.defined.includes("enemy"));
expect(definitions.family.defined.length).to.equal(3);
expect(definitions.family.excluded.length).to.equal(1);

//Objectives
expect(Defintions.objective.defined.includes("counter"));
expect(Defintions.objective.excluded.includes("Foo"));
expect(Defintions.objective.defined.length).to.equal(1);
expect(Defintions.objective.excluded.length).to.equal(1);
expect(definitions.objective.defined.includes("counter"));
expect(definitions.objective.excluded.includes("Foo"));
expect(definitions.objective.defined.length).to.equal(1);
expect(definitions.objective.excluded.length).to.equal(1);

//Names
expect(Defintions.name.defined.includes("Steve"));
expect(Defintions.name.excluded.includes("Creeper"));
expect(Defintions.name.defined.length).to.equal(1);
expect(Defintions.name.excluded.length).to.equal(1);
expect(definitions.name.defined.includes("Steve"));
expect(definitions.name.excluded.includes("Creeper"));
expect(definitions.name.defined.length).to.equal(1);
expect(definitions.name.excluded.length).to.equal(1);

done();
});
Expand Down

0 comments on commit ac9175a

Please sign in to comment.