forked from appsmithorg/appsmith
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: prevent lint warnings from blocking execution in js objects (app…
- Loading branch information
1 parent
97c5aee
commit 876d1a1
Showing
10 changed files
with
182 additions
and
40 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
...tegration/Smoke_TestSuite/ClientSideTests/JsFunctionExecution/JSFunctionExecution_spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { ObjectsRegistry } from "../../../../support/Objects/Registry"; | ||
|
||
const jsEditor = ObjectsRegistry.JSEditor; | ||
|
||
describe("JS Function Execution", function() { | ||
it("Allows execution of js function when lint warnings(not errors) are present in code", function() { | ||
jsEditor.CreateJSObject( | ||
`export default { | ||
myFun1: ()=>{ | ||
debugger; | ||
return "yes" | ||
} | ||
}`, | ||
true, | ||
true, | ||
false, | ||
); | ||
|
||
jsEditor.AssertParseError(false); | ||
}); | ||
|
||
it("Prevents execution of js function when parse errors are present in code", function() { | ||
jsEditor.CreateJSObject( | ||
`export default { | ||
myFun1: ()=>{ | ||
return "yes" | ||
}, | ||
myFun2: ()==>{} | ||
}`, | ||
true, | ||
true, | ||
false, | ||
); | ||
|
||
jsEditor.AssertParseError(true); | ||
}); | ||
|
||
it("Allows execution of other JS functions when lint error is present in code one JS function", function() { | ||
jsEditor.CreateJSObject( | ||
`export default { | ||
myFun1: (a ,b)=>{ | ||
return f | ||
}, | ||
myFun2 :()=>{ | ||
return "yes" | ||
} | ||
}`, | ||
true, | ||
true, | ||
false, | ||
); | ||
|
||
jsEditor.AssertParseError(false); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.