Skip to content

Commit

Permalink
feat(assertions): adds support for async fields
Browse files Browse the repository at this point in the history
  • Loading branch information
georgejecook committed May 21, 2020
1 parent a08fff6 commit 28f3275
Show file tree
Hide file tree
Showing 2 changed files with 145 additions and 77 deletions.
24 changes: 20 additions & 4 deletions frameworkTests/source/tests/BasicTests.bs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ end function

'@Test
function BT_EqualsFixForStubbedAAs() as void
aa = {"test":"value"}
aa = { "test": "value" }
m.expectOnce(aa, "getStubbedObject", [aa])

aa.getStubbedObject(aa)
end function

Expand All @@ -34,8 +34,8 @@ end function

'@Test
function BT_PrintResultsFixForStubbedAAs() as void
aa = {"test":"value"}
bb = {"other": "value"}
aa = { "test": "value" }
bb = { "other": "value" }
m.expectOnce(bb, "getStubbedObject", [aa])
m.assertEqual(aa, bb)
'not crashing on printing the wrong output is a pass
Expand All @@ -60,4 +60,20 @@ end function
function BT_urlParams_objects(aa) as void
m.assertEqual(aa.url, "http://101.rooibos.com")
m.assertEqual(aa.othervalue, 2)
end function

'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'@It tests async tests
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

'@Only
'@Test times out
function async_timeout()
item = { "id" : "item" }

m.AssertAsyncField(item, "id")
isFail = m.currentResult.isFail
m.currentResult.Reset()
m.assertTrue(isFail)

end function
Loading

0 comments on commit 28f3275

Please sign in to comment.