ImmutableJS fromJS()和Map()"ownerID"不匹配

Sai*_*lov 2 javascript node.js chai immutable.js chai-immutable

我正在使用chai-immutablenpm模块进行测试.这是测试:

it("runs the test", () => {
    const initialState = Map();
    const entries = ["entry"];
    const nextState = setEntries(initialState, entries);

    expect(nextState).to.equal(fromJS({
        entries : ["entry"]
    }));
});
Run Code Online (Sandbox Code Playgroud)

这是setEntries功能

export function setEntries(state, entries) {
    return state.set("entries", List(entries));
}
Run Code Online (Sandbox Code Playgroud)

npm test失败: 在此输入图像描述

这是什么ownerID?如何解决这个问题?

编辑:

我已经从头开始创建并重写了整个文件,但它确实有效.它与上一个文件完全相同.

仍然感兴趣为什么它发生....

ale*_*ejo 5

在调用测试运行器时,你在某处有这段代码吗?

import chai from 'chai';
import chaiImmutable from 'chai-immutable';

chai.use(chaiImmutable);
Run Code Online (Sandbox Code Playgroud)

通常你会在文件中使用它,比如test/test-config.js然后像这样调用你的跑步者:mocha --compilers js:babel-core/register --require ./test/test-config.js --recursive

(我假设你需要babel编译器,但重要的部分是--require ./test/test-config.js)