motoko 0.1.5 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +153 -9
- package/contrib/hljs.js +109 -110
- package/contrib/monaco.js +2 -2
- package/index.js +6 -0
- package/interpreter.js +6 -0
- package/lib/__tests__/index.test.js +40 -0
- package/lib/__tests__/interpreter.test.js +15 -0
- package/lib/file.js +66 -0
- package/lib/index.js +112 -78
- package/lib/package.js +2 -4
- package/package.json +8 -5
- package/versions/latest/didc.min.js +1 -0
- package/versions/latest/moc.min.js +1 -0
- package/versions/latest/moc_interpreter.min.js +1 -0
- package/lib/generated/moc.js +0 -1
- package/lib/index.spec.js +0 -31
package/lib/index.spec.js
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
const mo = require('.');
|
4
|
-
|
5
|
-
const actor = `
|
6
|
-
actor Main {
|
7
|
-
public func test() : async Nat {
|
8
|
-
123
|
9
|
-
}
|
10
|
-
}
|
11
|
-
`;
|
12
|
-
|
13
|
-
describe('check', () => {
|
14
|
-
test('works for a basic example', () => {
|
15
|
-
const file = 'test__check__.mo';
|
16
|
-
mo.addFile(file, actor);
|
17
|
-
expect(mo.check(file)).toStrictEqual([]);
|
18
|
-
});
|
19
|
-
});
|
20
|
-
|
21
|
-
describe('run', () => {
|
22
|
-
test('works for a basic example', () => {
|
23
|
-
const file = 'test__run__.mo';
|
24
|
-
mo.addFile(file, 'let x = 1 + 1; x');
|
25
|
-
expect(mo.run(file)).toStrictEqual({
|
26
|
-
result: 0,
|
27
|
-
stdout: '2 : Nat\n',
|
28
|
-
stderr: '',
|
29
|
-
});
|
30
|
-
});
|
31
|
-
});
|