Skip to content

Enable embroider-optimized scenario #92

@fsmanuel

Description

@fsmanuel

The embroider-optimized scenario tests fail with the following errors:

 not ok 6 Chrome 105.0 - [15 ms] - Unit | Validators | messages: it exists
    ---
        expected: >
            true
        stack: >
                at Object.eval (webpack://dummy/./tests/unit/validators/messages-test.js?:14:12)
        message: >
            failed, expected argument to be truthy, was: undefined
        negative: >
            false
        browser log: |
    ...
not ok 7 Chrome 105.0 - [35 ms] - Unit | Validators | messages: suppressWarnings set to true
    ---
        actual: >
            null
        stack: >
            TypeError: Cannot read properties of undefined (reading 'getMessageFor')
                at Object.eval (webpack://dummy/./tests/unit/validators/messages-test.js?:25:14)
        message: >
            Died on test #1: Cannot read properties of undefined (reading 'getMessageFor')
                at Object.eval (webpack://dummy/./tests/unit/validators/messages-test.js?:16:46)
        negative: >
            false
        browser log: |
    ...
not ok 8 Chrome 105.0 - [18 ms] - Unit | Validators | messages: suppressWarnings unset
    ---
        actual: >
            null
        stack: >
            TypeError: Cannot read properties of undefined (reading 'getMessageFor')
                at Object.eval (webpack://dummy/./tests/unit/validators/messages-test.js?:32:14)
        message: >
            Died on test #1: Cannot read properties of undefined (reading 'getMessageFor')
                at Object.eval (webpack://dummy/./tests/unit/validators/messages-test.js?:28:46)
        negative: >
            false
        browser log: |
    ...

Seems like instance is undefined inembroider-optimized scenario.

const specifier = '@ember-intl/cp-validations@validator:messages';
const instance = this.owner.lookup(specifier);
instance.getMessageFor('foobarbaz');

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