mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 17:45:22 +00:00
switch to inline snapshots in tests
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`flashFirmware normal flow 1`] = `
|
||||
Object {
|
||||
"options": Array [
|
||||
"-mno-unicode",
|
||||
],
|
||||
"script": "print(\\"test\\")",
|
||||
"type": "mpy.action.compile",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`flashFirmware user supplied firmware.zip success 1`] = `
|
||||
Object {
|
||||
"options": Array [
|
||||
"-mno-unicode",
|
||||
],
|
||||
"script": "print(\\"test\\")",
|
||||
"type": "mpy.action.compile",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`flashFirmware user supplied main.py 1`] = `
|
||||
Object {
|
||||
"options": Array [
|
||||
"-mno-unicode",
|
||||
],
|
||||
"script": "print(\\"test\\")",
|
||||
"type": "mpy.action.compile",
|
||||
}
|
||||
`;
|
||||
@@ -1,9 +0,0 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`compiler error works 1`] = `
|
||||
Array [
|
||||
"Traceback (most recent call last):",
|
||||
" File \\"main.py\\", line 1",
|
||||
"SyntaxError: invalid syntax",
|
||||
]
|
||||
`;
|
||||
@@ -92,7 +92,15 @@ describe('flashFirmware', () => {
|
||||
// then compile main.py to .mpy
|
||||
|
||||
action = await saga.take();
|
||||
expect(action).toMatchSnapshot();
|
||||
expect(action).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"options": Array [
|
||||
"-mno-unicode",
|
||||
],
|
||||
"script": "print(\\"test\\")",
|
||||
"type": "mpy.action.compile",
|
||||
}
|
||||
`);
|
||||
|
||||
const mpySize = 20;
|
||||
const mpyBinaryData = new Uint8Array(mpySize);
|
||||
@@ -209,7 +217,15 @@ describe('flashFirmware', () => {
|
||||
// the first step is to compile main.py to .mpy
|
||||
|
||||
let action = await saga.take();
|
||||
expect(action).toMatchSnapshot();
|
||||
expect(action).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"options": Array [
|
||||
"-mno-unicode",
|
||||
],
|
||||
"script": "print(\\"test\\")",
|
||||
"type": "mpy.action.compile",
|
||||
}
|
||||
`);
|
||||
|
||||
const mpySize = 20;
|
||||
const mpyBinaryData = new Uint8Array(mpySize);
|
||||
@@ -452,7 +468,15 @@ describe('flashFirmware', () => {
|
||||
// then compile main.py to .mpy
|
||||
|
||||
action = await saga.take();
|
||||
expect(action).toMatchSnapshot();
|
||||
expect(action).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"options": Array [
|
||||
"-mno-unicode",
|
||||
],
|
||||
"script": "print(\\"test\\")",
|
||||
"type": "mpy.action.compile",
|
||||
}
|
||||
`);
|
||||
|
||||
const mpySize = 20;
|
||||
const mpyBinaryData = new Uint8Array(mpySize);
|
||||
|
||||
@@ -37,7 +37,13 @@ test('compiler error works', async () => {
|
||||
const action = await saga.take();
|
||||
expect(action.type).toBe(MpyActionType.DidFailToCompile);
|
||||
const { err } = action as MpyDidFailToCompileAction;
|
||||
expect(err).toMatchSnapshot();
|
||||
expect(err).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
"Traceback (most recent call last):",
|
||||
" File \\"main.py\\", line 1",
|
||||
"SyntaxError: invalid syntax",
|
||||
]
|
||||
`);
|
||||
|
||||
await saga.end();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user