Skip to content
This repository was archived by the owner on Mar 26, 2020. It is now read-only.
This repository was archived by the owner on Mar 26, 2020. It is now read-only.

Add support for 'require' #8

@ccidral

Description

@ccidral

require() does not work in lotte tests. It would be awesome if we could require() our own modules though. In my tests, I usually startup my web server right in the test code, then inject dependencies in the web server and then I mock the desired behavior according to each test.

For example:

@base 'http://localhost:10000'
@title 'Foo bar'

{WebServer} = require '../webserver'

class EmptyApp
  _searchResult: []

  searchStuff: (terms) ->
    return _searchResult;

app = new EmptyApp

new WebServer(10000, app).start =>
  @open '/', ->

    @describe 'Search test', ->
      app._searchResult = ['foo', 'bar']
      # do a search, submit the form, assert things, etc
      @success()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions