Skip to content

LeonardMF/jovo-sample-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Jovo Unit Tests with User Data

This sample is based on the Jovo Template: Hello World. Created with jovo new. Than edit to use User Data in the Unit Tests.

Required Installation

  • Node v12
  • Jovo CLI Version: 3.0.15

Update

Works again with new Jovo version:

    Jovo packages of current project:
        jovo-core: 3.0.17
        jovo-db-filedb: 3.0.18
        jovo-framework: 3.0.19
        jovo-platform-alexa: 3.0.22
        jovo-platform-dialogflow: 3.0.17
        jovo-platform-googleassistant: 3.0.19
        jovo-plugin-debugger: 3.0.17

Just run jovo update to get new version.

Reproduce the Error

  1. Change Directory:

     $ cd helloworld
    
  2. Install Dependencies:

      $ npm install
    
  3. Run Tests:

     $ npm test   
    

Console Log:

    FAIL  test/sample.test.js
    PLATFORM: Alexa INTENTS
        ✓ test flag should be true (214 ms)
        ✓ test flag should be false (4 ms)
    PLATFORM: GoogleAssistant INTENTS
        ✕ test flag should be true (8 ms)
        ✕ test flag should be false (3 ms)

    ● PLATFORM: GoogleAssistant INTENTS › test flag should be true

        expect(received).toMatch(expected)

        Expected substring: "test_flag is true"
        Received string:    "test_flag is undefined"

    ● PLATFORM: GoogleAssistant INTENTS › test flag should be false

        expect(received).toMatch(expected)

        Expected substring: "test_flag is false"
        Received string:    "test_flag is undefined"

    Test Suites: 1 failed, 1 total
    Tests:       2 failed, 2 passed, 4 total

As you can see in the console log, the this.$user.$data.test_flag in the unit tests for Google Assistants are undefined. In the tests for Alexa the values are correct.

Additional a db folder gets generated in the directory above the project.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published