Skip to content

Simplify result comparison tests #602

@ark120202

Description

@ark120202

Most of unit tests have a very simple pattern:

const result = util.transpileAndExecute(`
	return foo(${case});
`)

expect(result).toBe(foo(case))

Because foo has to be available both in transpiled string and test module, it may become quite complex (when instead of foo(case) there are some complex constructs). Instead we may emit both Lua and JS, execute JS in a vm and compare results.

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