@@ -27,7 +27,7 @@ describe("test case code emitter", () => {
2727 return expect ( TestCaseEmitter . emit ( test ) ) . resolves . toEqual ( {
2828 name : "example test case" ,
2929 test : `it("${ test . name } ", async () => {await tests.example_test_case(driver, vars);await driver.getTitle().then(title => {expect(title).toBeDefined();});});` ,
30- function : "tests.example_test_case = async function example_test_case(driver, vars) {}"
30+ function : "tests.example_test_case = async function example_test_case(driver, vars, opts ) {}"
3131 } ) ;
3232 } ) ;
3333 it ( "should emit a test with a single command" , ( ) => {
@@ -43,7 +43,7 @@ describe("test case code emitter", () => {
4343 return expect ( TestCaseEmitter . emit ( test ) ) . resolves . toEqual ( {
4444 name : "example test case" ,
4545 test : `it("${ test . name } ", async () => {await tests.example_test_case(driver, vars);await driver.getTitle().then(title => {expect(title).toBeDefined();});});` ,
46- function : `tests.example_test_case = async function example_test_case(driver, vars) {await driver.get(BASE_URL + "${ test . commands [ 0 ] . target } ");}`
46+ function : `tests.example_test_case = async function example_test_case(driver, vars, opts ) {await driver.get(BASE_URL + "${ test . commands [ 0 ] . target } ");}`
4747 } ) ;
4848 } ) ;
4949 it ( "should emit a test with multiple commands" , ( ) => {
@@ -71,7 +71,7 @@ describe("test case code emitter", () => {
7171 return expect ( TestCaseEmitter . emit ( test ) ) . resolves . toEqual ( {
7272 name : "example test case" ,
7373 test : `it("${ test . name } ", async () => {await tests.example_test_case(driver, vars);await driver.getTitle().then(title => {expect(title).toBeDefined();});});` ,
74- function : `tests.example_test_case = async function example_test_case(driver, vars) {await driver.get(BASE_URL + "${ test . commands [ 0 ] . target } ");await driver.get(BASE_URL + "${ test . commands [ 1 ] . target } ");await driver.get(BASE_URL + "${ test . commands [ 2 ] . target } ");}`
74+ function : `tests.example_test_case = async function example_test_case(driver, vars, opts ) {await driver.get(BASE_URL + "${ test . commands [ 0 ] . target } ");await driver.get(BASE_URL + "${ test . commands [ 1 ] . target } ");await driver.get(BASE_URL + "${ test . commands [ 2 ] . target } ");}`
7575 } ) ;
7676 } ) ;
7777 it ( "should reject a test with failed commands" , ( ) => {
@@ -133,7 +133,7 @@ describe("test case code emitter", () => {
133133 return expect ( TestCaseEmitter . emit ( test , { silenceErrors : true } ) ) . resolves . toEqual ( {
134134 name : "silence" ,
135135 test : "it(\"silence\", async () => {await tests.silence(driver, vars);await driver.getTitle().then(title => {expect(title).toBeDefined();});});" ,
136- function : "tests.silence = async function silence(driver, vars) {throw new Error(\"Unknown command doesntExist\");}"
136+ function : "tests.silence = async function silence(driver, vars, opts ) {throw new Error(\"Unknown command doesntExist\");}"
137137 } ) ;
138138 } ) ;
139139} ) ;
0 commit comments