So I just guess that this code on a screencast
//Ensure that a handler is properly attached to the div and updates its content
//Given:
var div = myHelper.createDiv('Foo');
div.on('click', {div.update('Bar');});
//Act:
t.click('div');
//Assert:
t.hasContent('Bar');
There are also some BDD style test frameworks for javascript, which make the test also a documentation itself, for example - https://github.com/SteveSanderson/knock ... haviors.js
I really like the rpsec syntax myself, it looks like one step further compared to a conventional unit tests:
describe "Class1 created without any parameters" do
c = Class1.new
it "does feature1" do
c.do1(5).should_return 10
end
it "allow to do feature2" do
c.do2().should be_empty
...
end
end
So main idea here is that for examples and screencasts it worths to find a really good case when it is clear what exactly are we testing, what is a test case, what are steps and what do we check. At this moment screencasts are focusing on the testing framework itself, Siesta, and it is expected that a user is very good in tests himself and understands their purpose. I think a lot of Siesta users have no idea what to test.