errors and warnings / stdlib / E8108
E8108 error
wowlua:test / wowlua:mock imported outside a test file
- area
- stdlib (x8xxx)
- fails the build
- yes
A file of the addon imports wowlua:test or wowlua:mock. These modules exist
only in wowlua test's emulated client, not in the game, and test files are
never part of an addon build. Move the code into a test file: a
*.test.wowlua file, or a file under tests/.
Example
import expect from "wowlua:test" expect(1 + 1).toBe(2)import test, expect from "wowlua:test" @test("adds")local function adds() expect(1 + 1).toBe(2)endThe compiler reports it like this:
error[E8108]: `wowlua:test` is only for test files ┌─ src/main.wowlua:1:20 │ 1 │ import expect from "wowlua:test" │ ^^^^^^^^^^^^^ imported here │ = help: test files are `*.test.wowlua` files and the files under `tests/`
Related codes
| code | message |
|---|---|
| E8119 | import internal outside a test file |
Offline
$ wowlua explain E8108 E8108 (error): wowlua:test / wowlua:mock imported outside a test file