Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
? "\\home\\whatever\\Untitled.ipynb"
: "/home/whatever/Untitled.ipynb";
expect(responseActions).toEqual([
{
type: actions.FETCH_CONTENT_FULFILLED,
payload: {
contentRef: "cRef",
kernelRef: "kRef",
filepath: filepath,
model: {
type: "notebook",
mimetype: "application/x-ipynb+json",
format: "json",
content: toJS(
monocellNotebook
.setIn(["metadata", "kernel_info", "name"], "hylang")
.setIn(["metadata", "language_info", "name"], "hylang")
),
writable: true,
name: "Untitled.ipynb",
path: filepath,
created: expect.any(String),
last_modified: expect.any(String)
}
}
}
]);
});
});
? "\\home\\whatever2\\some.ipynb"
: "/home/whatever2/some.ipynb";
expect(responseActions).toEqual([
{
type: actions.FETCH_CONTENT_FULFILLED,
payload: {
contentRef: "cRef",
kernelRef: "kRef",
filepath,
model: {
type: "notebook",
mimetype: "application/x-ipynb+json",
format: "json",
content: toJS(
monocellNotebook
.setIn(["metadata", "kernel_info", "name"], "hylang")
.setIn(["metadata", "language_info", "name"], "hylang")
),
writable: true,
name: "some.ipynb",
path: filepath,
created: expect.any(String),
last_modified: expect.any(String)
}
}
}
]);
});
});
function buildDummyNotebook(config) {
let notebook = monocellNotebook.setIn(
["metadata", "kernelspec", "name"],
"python2"
);
if (config) {
if (config.codeCellCount) {
for (let i = 1; i < config.codeCellCount; i++) {
notebook = appendCellToNotebook(notebook, emptyCodeCell);
}
}
if (config.markdownCellCount) {
for (let i = 0; i < config.markdownCellCount; i++) {
notebook = appendCellToNotebook(
notebook,
emptyCodeCell.set("cell_type", "markdown")
function buildFixtureNotebook(config: JSONObject) {
let notebook = monocellNotebook.setIn(
["metadata", "kernelspec", "name"],
"python2"
);
if (config) {
if (config.codeCellCount) {
for (let i = 1; i < config.codeCellCount; i++) {
notebook = appendCellToNotebook(notebook, emptyCodeCell);
}
}
if (config.markdownCellCount) {
for (let i = 0; i < config.markdownCellCount; i++) {
notebook = appendCellToNotebook(
notebook,
emptyMarkdownCell.set("cell_type", "markdown")