Giter Site home page Giter Site logo

Comments (3)

jgauna avatar jgauna commented on May 21, 2024

Process of testing

I propose to use Jasmine instead of Mocha, the reasons are that Mocha needs some extra packages to run (although it adds more flexibility), in long term projects, it will affect the maintainability regarding versions and more single pieces to keep upgraded. Jasmine is the choosen (?

Regarding the methodology it will be something like this (maybe):

yo deloitte will generate a folder called test with this structure:

  • test
    • stories
    • tests
    • reports

The .story file should follow the BDD principles:

modal-test.story

Scenario:
I will see a "start course" modal on the screen after log in

GIVEN I'm logged in <url>
WHEN <element> is loaded
THEN I will see a <modal>

Details:
url|element|modal
http://lala.com|#container|#modal

We will write .story files inside the stories folder, which will be in relation (one-to-one) with a .js test file (inside the tests folder).

We should create a command like "yo deloitte:build tests" (correct me if the yo command syntax is wrong) which will establish the relation between the .story file and .js file like:

modal-test.js example

/*
SCENARIO:
I will see a "start course" modal on the screen after log in

GIVEN I'm logged in <url>
WHEN <element> is loaded
THEN I will see a <modal>

Details:
url|element|modal
http://lala.com|#container|#modal


*/

#### FIXED JASMINE CODE!

describe('GIVEN I'm logged in http://lala.com', function() {
    // Future test  written
});

describe('WHEN #container is loaded', function() {
    // Future test  written
});

describe('THEN I will see a #modal', function() {
    // Future test  written
});

Reports

For the reports folder we can use Istanbul (https://github.com/gotwarlost/istanbul)

So, we should create yo deloitte:build report and do some magic trick to get the reports ... to be continued

from generator-tamagotchi.

facundocabrera avatar facundocabrera commented on May 21, 2024

That's perfect. Just start with this!

from generator-tamagotchi.

facundocabrera avatar facundocabrera commented on May 21, 2024

I'm thinking a little more. Please evaluate as a possible implementation the creation of a new generator only handling testing stuff. 😄

from generator-tamagotchi.

Related Issues (19)

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.