Skip to content

Instantly share code, notes, and snippets.

@zzen
Created August 17, 2010 19:54
Show Gist options
  • Save zzen/531709 to your computer and use it in GitHub Desktop.
Save zzen/531709 to your computer and use it in GitHub Desktop.
test('My First Test', [
on('GET /test').return('{"result":"something"', {status:200,SetCookie:"abcdefgh..."}).parse('$id',/^xxx/),
on('GET /lorem/$id').return('{"result":"something"', {status:200,SetCookie:"abcdefgh..."})
]);
suite('TestGrid self-hoist suite', [
test('create new test suite',
on('POST /suites',
"suite('new suite',[test('new test'),on('GET /').result('<html></html>')"
).result(
{uri: '/suites/$id{\d+}'}
)
),
test('edit test',
on('GET /suites').
result([$testId#{\d+}]).
on('POST $testId1, "test('edited test','on(\"GET /\").result(\"<html></html>\")')").
result(null,{status:200})
)
])
@zzen
Copy link
Author

zzen commented Aug 17, 2010

the style:

on('POST /object', {data:123}).result({uri: '/object/###'}).on("GET result['uri']").result({data:123})

@zzen
Copy link
Author

zzen commented Aug 17, 2010

on('POST /object', {data:123}).result({uri: '/object/$id{###}'})
.on("GET /object/$id").result({data:123, self: /object/$id})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment