Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.
This repository was archived by the owner on May 29, 2019. It is now read-only.

Proposal: API change #1

Open
Open
@bajtos

Description

@bajtos

I am proposing two changes:

  1. Make this module a collection of utilities, i.e. move the current implementation out of /index.js into lib/ folder, change the way how the module is used:

    var lt = require('loopback-testing').TestCaseHelper;
    lt.describe(/* ... */)
    
    // this way I can add my new code as
    var TestDataBuilder = require('loopback-testing').TestDataBuilder;
    
  2. Add a function that will merge install describe/it/etc. as globals, possibly extending symbols already defined by Mocha.

    require('loopback-testing').mocha('bdd');
    // now I can write
    //   describe.whenCalledRemotely
    //   given.model('Product', /*.. */)

    Later we can implement support for other interfaces than bdd and possibly other test frameworks like TAP.

@ritch what's you opinion? What was the reason why you decided to not amend mocha's global symbols, as we discussed in the other pull request?

Perhaps the second point should be implemented by a standalone module depending on loopback-testing, e.g. loopback-mocha?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions