Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dhowe committed Jan 28, 2024
1 parent 3070c2e commit 6431337
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/dist/riscript.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -774,10 +774,10 @@ describe(title, function() {
res = riscript.evaluate("$[a | b].name", context);
expect(res).to.be.oneOf(["Lucy", "Sam"]);
});
it("Pass scripting as this", function() {
it("Pass context as this", function() {
let checkThis = function(word) {
expect(this).eq(riscript);
return word + (this == riscript ? " success" : " failure");
expect(this).eq(riscript.visitor.context);
return word + (this === riscript.visitor.context ? " success" : " failure");
};
let res = riscript.evaluate("[hello].checkThis", { checkThis });
expect(res).eq("hello success");
Expand Down Expand Up @@ -877,7 +877,7 @@ describe(title, function() {
res = riscript.evaluate("The [dog | dog | dog].rhymes", 0, { silent: true });
expect(res).eq("The dog.rhymes");
let addRhyme2 = function(word) {
return word + " rhymes with bog" + this.RiTa.randi(1);
return word + " rhymes with bog" + riscript.RiTa.randi(1);
};
expect(riscript.transforms.rhymes2).is.undefined;
riscript.addTransform("rhymes2", addRhyme2);
Expand Down

0 comments on commit 6431337

Please sign in to comment.