Code Monkey home page Code Monkey logo

sweetest's People

Contributors

christopherkoellner avatar eder7 avatar nitrico avatar xa17d avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sweetest's Issues

Remove module testing configuration

Problem

  • Module testing configuration makes choices of the dependency management feature obscure
  • Adds boilerplate, as it has to be referenced in each steps class

Solution

  • Force test or steps to explicitly initialize the dependency on their own
  • To resolve a dependency getAssignableTo is used, you can not have two dependencies of the same supertype separately; to mitigate that:
    • Dependency lookup needs to become concrete, which means, when you need a dependency, it's not enough to register a specific dependency
    • It needs to be explicitly pointed out that a dependency X can also be used if type Y is needed

v2 roadmap

  • Modularization
    • extract core code
    • separate Mockito mock provider from core code
    • extract v1 API

Improve test/steps configuration usability

Problem

Currently we have to override the configuration in order to supply it to the framework. That's fairly inconvenient:

override fun configure() = super.configure()
        .requireReal<AuthManager>()

It would be better to have something like this:

init {
    requireReal<AuthManager>()
}

Refactoring

  • Get rid of global state
  • Move type lookup for consumption and configuration closer together
  • Extract data structure of dependency configuration and state from logic

Improve error messages

  • Use specific exception types
    • Adapt existing tests accordingly
  • Tests for all error cases
  • Condense exception messages so cause stack doesn't need to be read through anymore
  • Streamline language and formatting (e.g. use of quotes and line breaks)
  • Add links to readme and guidelines for further reference

Separate JVM-specific from Kotlin-only code

Problem

  • For Kotlin-only code we can't use sweetest

Research

  • Do we also need to separate coroutines utilities?
  • Is kotlin-reflect available in Kotlin multiplatform?
  • Currently we hardcode sweetest with Cucumber and JUnit โ€“ can that stay that way?

Solution

  • Abstract mock creation
  • Make automatic mock creation optional
  • Module implementing mock creation
  • Introduce build variants for Kotlin-only and JVM

Get rid of TestContext

Problem

  • TestContext needs to be referenced in each steps class

Solution

  • Could be handled in background for non-Cucumber tests

Use member functions instead of extensions

Problem

In order to use dependency and steps functions we need to import them explicitly, as they are extension functions.

Solution

They should be direct parts of the base classes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.