Skip to content

Commit

Permalink
Add test for backwards compatibility workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
jasongrout committed Aug 5, 2019
1 parent 62c7cdb commit d752554
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/test-services/src/kernel/messages.spec.ts
Expand Up @@ -168,4 +168,33 @@ describe('kernel/messages', () => {
expect(KernelMessage.isInputRequestMsg(msg2)).to.equal(false);
});
});

describe('KernelMessage.createMessage()', () => {
// Tests deprecated option workaround. Should be deleted in services 5.0.
// See https://github.com/jupyterlab/jupyterlab/pull/6949
it('contains a backwards-compatibility workaround for services 4.0 for a deprecated comm_info_request content', () => {
let commRequest = KernelMessage.createMessage({
msgType: 'comm_info_request',
channel: 'shell',
session: 'baz',
content: {
target: 'example'
}
});
expect(commRequest.content.target_name).to.equal('example');
expect(commRequest.content.target).to.be.undefined;

commRequest = KernelMessage.createMessage({
msgType: 'comm_info_request',
channel: 'shell',
session: 'baz',
content: {
target_name: 'real_target',
target: 'example'
}
});
expect(commRequest.content.target_name).to.equal('real_target');
expect(commRequest.content.target).to.be.undefined;
});
});
});

0 comments on commit d752554

Please sign in to comment.