diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f91dda83..48fdb63f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,8 +39,8 @@ jobs: - name: Julia CI run: julia -e 'include("ci/packages.jl")' shell: bash -# - name: Run tests 👩🏾‍💻 -# run: atom --test spec + - name: Run tests 👩🏾‍💻 + run: atom --test spec Lint: if: "!contains(github.event.head_commit.message, '[skip ci]')" diff --git a/package-lock.json b/package-lock.json index 64506565..d94f034a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -404,6 +404,61 @@ "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", "dev": true }, + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "atom-jasmine3-test-runner": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/atom-jasmine3-test-runner/-/atom-jasmine3-test-runner-4.4.3.tgz", + "integrity": "sha512-xeaPBlBbDSIQYlKFr8Fj/JUocnRI8UaK0ZkF7Vx4bNdcWWpo/01kRu1lpWmxED31wodRQgKAvaidfra/KbjFaQ==", + "dev": true, + "requires": { + "etch": "^0.14.0", + "find-parent-dir": "^0.3.0", + "fs-plus": "3.1.1", + "glob": "^7.1.6", + "grim": "^2.0.2", + "jasmine": "~3.5.0", + "semver": "^7.1.3", + "temp": "^0.9.1", + "underscore-plus": "^1.7.0" + }, + "dependencies": { + "grim": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/grim/-/grim-2.0.2.tgz", + "integrity": "sha512-Qj7hTJRfd87E/gUgfvM0YIH/g2UA2SV6niv6BYXk1o6w4mhgv+QyYM1EjOJQljvzgEj4SqSsRWldXIeKHz3e3Q==", + "dev": true, + "requires": { + "event-kit": "^2.0.0" + } + }, + "semver": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.1.3.tgz", + "integrity": "sha512-ekM0zfiA9SCBlsKa2X1hxyxiI4L3B6EbVJkkdgQXnSEEaHlGdvyodMruTiulSRWMMB4NeIuYNMC9rTKTz97GxA==", + "dev": true + }, + "underscore": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.2.tgz", + "integrity": "sha512-D39qtimx0c1fI3ya1Lnhk3E9nONswSKhnffBI0gME9C99fYOkNi04xs8K6pePLhvl1frbDemkaBQ5ikWllR2HQ==", + "dev": true + }, + "underscore-plus": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/underscore-plus/-/underscore-plus-1.7.0.tgz", + "integrity": "sha512-A3BEzkeicFLnr+U/Q3EyWwJAQPbA19mtZZ4h+lLq3ttm9kn8WC4R3YpuJZEXmWdLjYP47Zc8aLZm9kwdv+zzvA==", + "dev": true, + "requires": { + "underscore": "^1.9.1" + } + } + } + }, "atom-package-deps": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/atom-package-deps/-/atom-package-deps-4.6.0.tgz", @@ -1441,6 +1496,12 @@ "resolved": "https://registry.npmjs.org/etch/-/etch-0.14.0.tgz", "integrity": "sha512-puqbFxz7lSm+YK6Q+bvRkNndRv6PRvGscSEhcFjmtL4nX/Az5rRCNPvK3aVTde85c/L5X0vI5kqfnpYddRalJQ==" }, + "event-kit": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/event-kit/-/event-kit-2.5.3.tgz", + "integrity": "sha512-b7Qi1JNzY4BfAYfnIRanLk0DOD1gdkWHT4GISIn8Q2tAf3LpU8SP2CMwWaq40imYoKWbtN4ZhbSRxvsnikooZQ==", + "dev": true + }, "expand-template": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", @@ -1493,6 +1554,12 @@ "flat-cache": "^2.0.1" } }, + "find-parent-dir": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/find-parent-dir/-/find-parent-dir-0.3.0.tgz", + "integrity": "sha1-M8RLQpqysvBkYpnF+fcY83b/jVQ=", + "dev": true + }, "find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", @@ -1511,6 +1578,17 @@ "flatted": "^2.0.0", "rimraf": "2.6.3", "write": "1.0.3" + }, + "dependencies": { + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } } }, "flatted": { @@ -1524,6 +1602,18 @@ "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" }, + "fs-plus": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fs-plus/-/fs-plus-3.1.1.tgz", + "integrity": "sha512-Se2PJdOWXqos1qVTkvqqjb0CSnfBnwwD+pq+z4ksT+e97mEShod/hrNg0TRCCsXPbJzcIq+NuzQhigunMWMJUA==", + "dev": true, + "requires": { + "async": "^1.5.2", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.2", + "underscore-plus": "1.x" + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -1919,6 +2009,22 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, + "jasmine": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.5.0.tgz", + "integrity": "sha512-DYypSryORqzsGoMazemIHUfMkXM7I7easFaxAvNM3Mr6Xz3Fy36TupTrAOxZWN8MVKEU5xECv22J4tUQf3uBzQ==", + "dev": true, + "requires": { + "glob": "^7.1.4", + "jasmine-core": "~3.5.0" + } + }, + "jasmine-core": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.5.0.tgz", + "integrity": "sha512-nCeAiw37MIMA9w9IXso7bRaLl+c/ef3wnxsoSAlYrzS+Ot0zTG6nU8G/cIfGkqpkjX2wNaIW9RFG0TwIFnG6bA==", + "dev": true + }, "jquery": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/jquery/-/jquery-2.1.4.tgz", @@ -2552,9 +2658,9 @@ } }, "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", "dev": true, "requires": { "glob": "^7.1.3" @@ -2958,6 +3064,26 @@ "xtend": "^4.0.0" } }, + "temp": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/temp/-/temp-0.9.1.tgz", + "integrity": "sha512-WMuOgiua1xb5R56lE0eH6ivpVmg/lq2OHm4+LtT/xtEtPQ+sz6N3bBM6WZ5FvO1lO4IKIOb43qnhoc4qxP5OeA==", + "dev": true, + "requires": { + "rimraf": "~2.6.2" + }, + "dependencies": { + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", diff --git a/package.json b/package.json index ae25782e..f98eb872 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "@types/semver": "^7.1.0", "@types/ssh2": "^0.5.41", "@types/underscore": "^1.9.4", + "atom-jasmine3-test-runner": "^4.4.3", "eslint": "latest", "@typescript-eslint/eslint-plugin": "latest", "@typescript-eslint/parser": "latest", @@ -52,7 +53,8 @@ "eslint-plugin-coffee": "latest", "eslint-plugin-only-warn": "latest", "prettier": "latest", - "tslint": "latest" + "tslint": "latest", + "jasmine": "^3.5.0" }, "scripts": { "postinstall": "node script/postinstall.js", @@ -116,6 +118,7 @@ "ink", "language-julia" ], + "atomTestRunner": "./spec/runner", "prettier": { "semi": false, "tabWidth": 2, diff --git a/spec/client.d.ts b/spec/client.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/spec/client.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/spec/client.js b/spec/client.js index f629fda4..a6e80310 100644 --- a/spec/client.js +++ b/spec/client.js @@ -1,3 +1,4 @@ +"use strict"; /* * decaffeinate suggestions: * DS102: Remove unnecessary code created because of implicit returns @@ -5,139 +6,122 @@ * DS207: Consider shorter variations of null checks * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ -const path = require('path'); -const juno = require('../lib/julia-client'); - -const {client} = juno.connection; - -module.exports = function() { - - const clientStatus = () => [client.isActive(), client.isWorking()]; - const {echo, evalsimple} = client.import(['echo', 'evalsimple']); - - describe("before booting", function() { - const checkPath = p => juno.misc.paths.getVersion(p); - - it("can invalidate a non-existant julia binary", () => waitsFor(done => checkPath(path.join(__dirname, "foobar")).catch(() => done()))); - - it("can validate a julia command", () => waitsFor(done => checkPath("julia").then(() => done()))); - - return it("can invalidate a non-existant julia command", () => waitsFor(done => checkPath("nojulia").catch(() => done()))); - }); - - let conn = null; - beforeEach(function() { - if (conn != null) { - return client.attach(conn); - } - }); - - describe("when booting the client", function() { - - it("recognises the client's state before boot", () => expect(clientStatus()).toEqual([false, false])); - - it("initiates the boot", function() { - waitsForPromise(() => juno.connection.local.start()); - return runs(() => conn = client.conn); - }); - - return it("waits for the boot to complete", function() { - const pong = client.import('ping')(); - expect(clientStatus()).toEqual([true, true]); - return waitsFor('the client to boot', 5*60*1000, done => pong.then(function(pong) { - expect(pong).toBe('pong'); - return done(); - })); - }); - }); - - // it "recognises the client's state after boot", -> - // expect(clientStatus()).toEqual [true, false] - - describe("while the client is active", function() { - - it("can send and receive nested objects, strings and arrays", function() { - const msg = {x: 1, y: [1,2,3], z: "foo"}; - return waitsForPromise(() => echo(msg).then(response => expect(response).toEqual(msg))); +Object.defineProperty(exports, "__esModule", { value: true }); +const jasmine = require('jasmine'); +const jasmine_1 = require("jasmine"); +const path = require("path"); +const juno = require("../lib/julia-client"); +const { client } = juno.connection; +module.exports = function () { + const clientStatus = () => [client.isActive(), client.isWorking()]; + const { echo, evalsimple } = client.import(["echo", "evalsimple"]); + jasmine_1.describe("before booting", function () { + const checkPath = p => juno.misc.paths.getVersion(p); + jasmine_1.it("can invalidate a non-existant julia binary", () => jasmine_1.it("", done => checkPath(path.join(__dirname, "foobar")).catch(() => done()))); + jasmine_1.it("can validate a julia command", () => jasmine_1.it("", done => checkPath("julia").then(() => done()))); + jasmine_1.it("can invalidate a non-existant julia command", () => jasmine_1.it("", done => checkPath("nojulia").catch(() => done()))); }); - - it("can evaluate code and return the result", function() { - const remote = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map(x => evalsimple(`${x}^2`)); - return waitsForPromise(() => Promise.all(remote).then(remote => expect(remote).toEqual(([1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map((x) => Math.pow(x, 2)))))); - }); - - it("can rpc into the frontend", function() { - let x; - client.handle({test(x) { return Math.pow(x, 2); }}); - const remote = ((() => { - let i; - const result = []; - for (i = 1, x = i; i <= 10; i++, x = i) { - result.push(evalsimple(`Atom.@rpc test(${x})`)); - } - return result; - })()); - return waitsForPromise(() => Promise.all(remote).then(remote => expect(remote).toEqual(((() => { - const result1 = []; - for (x = 1; x <= 10; x++) { - result1.push(Math.pow(x, 2)); + let conn = null; + jasmine_1.beforeEach(function () { + if (conn != null) { + client.attach(conn); } - return result1; - })())))); }); - - it("can retrieve promise values from the frontend", function() { - client.handle({test(x) { return Promise.resolve(x); }}); - return waitsForPromise(() => evalsimple("Atom.@rpc test(2)").then(x => expect(x).toBe(2))); + jasmine_1.describe("when booting the client", function () { + jasmine_1.it("recognises the client's state before boot", () => jasmine_1.expect(clientStatus()).toEqual([false, false])); + jasmine_1.it("initiates the boot", async function () { + await juno.connection.local.start(); + conn = client.conn; + }); + jasmine_1.it("waits for the boot to complete", function () { + const pong = client.import("ping")(); + jasmine_1.expect(clientStatus()).toEqual([true, true]); + jasmine_1.it("the client to boot", setTimeout(done => { + pong.then(function (pong) { + jasmine_1.expect(pong).toBe("pong"); + done(); + }); + }, 5 * 60 * 1000)); + }); + // it "recognises the client's state after boot", -> + // expect(clientStatus()).toEqual [true, false] + jasmine_1.describe("while the client is active", function () { + jasmine_1.it("can send and receive nested objects, strings and arrays", async function () { + const msg = { x: 1, y: [1, 2, 3], z: "foo" }; + return await (() => echo(msg).then(response => jasmine_1.expect(response).toEqual(msg))); + }); + jasmine_1.it("can evaluate code and return the result", function () { + const remote = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map(x => evalsimple(`${x}^2`)); + return Promise.all(remote).then(remote => jasmine_1.expect(remote).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map(x => Math.pow(x, 2)))); + }); + jasmine_1.it("can rpc into the frontend", function () { + let x; + client.handle({ + test(x) { + Math.pow(x, 2); + } + }); + const remote = (() => { + let i; + const result = []; + for (i = 1, x = i; i <= 10; i++, x = i) { + result.push(evalsimple(`Atom.@rpc test(${x})`)); + } + result; + })(); + Promise.all(remote).then(remote => jasmine_1.expect(remote).toEqual((() => { + const result1 = []; + for (x = 1; x <= 10; x++) { + result1.push(Math.pow(x, 2)); + } + result1; + })())); + }); + jasmine_1.it("can retrieve promise values from the frontend", async function (done) { + client.handle({ + test(x) { + Promise.resolve(x); + } + }); + await evalsimple("Atom.@rpc test(2)").then(x => jasmine_1.expect(x).toBe(2)); + done(); + }); + jasmine_1.describe("when using callbacks", function () { + let { cbs, workingSpy, doneSpy } = {}; + jasmine_1.beforeEach(function () { + client.onWorking((workingSpy = jasmine.createSpy("working"))); + client.onDone((doneSpy = jasmine.createSpy("done")))((cbs = [1, 2, 3, 4, 5].map(i => evalsimple("peakflops(100)")))); + }); + jasmine_1.it("enters loading state", () => jasmine_1.expect(client.isWorking()).toBe(true)); + // it "emits a working event", -> + // expect(workingSpy.calls.length).toBe(1) + jasmine_1.it("isn't done yet", () => jasmine_1.expect(doneSpy).not.toHaveBeenCalled()); + jasmine_1.describe("when they finish", function () { + jasmine_1.beforeEach(() => setTimeout(done => Promise.all(cbs).then(done)), 10 * 1000); + jasmine_1.it("stops loading after they are done", () => jasmine_1.expect(client.isWorking()).toBe(false)); + jasmine_1.it("emits a done event", () => jasmine_1.expect(doneSpy.calls.length).toBe(1)); + }); + }); + jasmine_1.it("can handle a large number of concurrent callbacks", async function () { + const n = 100; + const cbs = __range__(0, n, false).map(i => evalsimple(`sleep(rand()); ${i}^2`)); + await Promise.all(cbs).then(xs => jasmine_1.expect(xs).toEqual(__range__(0, n, false).map(x => Math.pow(x, 2)))); + }); + }); + jasmine_1.it("handles shutdown correctly", function () { + jasmine_1.it("", done => evalsimple("exit()").catch(() => done())); + jasmine_1.expect(client.isWorking()).toBe(false); + jasmine_1.expect(clientStatus()).toEqual([false, false]); + }); }); - - describe("when using callbacks", function() { - let {cbs, workingSpy, doneSpy} = {}; - - beforeEach(function() { - client.onWorking((workingSpy = jasmine.createSpy('working'))); - client.onDone((doneSpy = jasmine.createSpy('done'))); - return cbs = ([1, 2, 3, 4, 5].map((i) => evalsimple("peakflops(100)"))); - }); - - it("enters loading state", () => expect(client.isWorking()).toBe(true)); - - // it "emits a working event", -> - // expect(workingSpy.calls.length).toBe(1) - - it("isn't done yet", () => expect(doneSpy).not.toHaveBeenCalled()); - - return describe("when they finish", function() { - - beforeEach(() => waitsFor(10*1000, done => Promise.all(cbs).then(done))); - - it("stops loading after they are done", () => expect(client.isWorking()).toBe(false)); - - return it("emits a done event", () => expect(doneSpy.calls.length).toBe(1)); - }); - }); - - return it("can handle a large number of concurrent callbacks", function() { - const n = 100; - const cbs = (__range__(0, n, false).map((i) => evalsimple(`sleep(rand()); ${i}^2`))); - return waitsForPromise(() => Promise.all(cbs).then(xs => expect(xs).toEqual((__range__(0, n, false).map((x) => Math.pow(x, 2)))))); - }); - }); - - return it("handles shutdown correctly", function() { - waitsFor(done => evalsimple('exit()').catch(() => done())); - return runs(function() { - expect(client.isWorking()).toBe(false); - return expect(clientStatus()).toEqual([false, false]);}); -}); + function __range__(left, right, inclusive) { + let range = []; + let ascending = left < right; + let end = !inclusive ? right : ascending ? right + 1 : right - 1; + for (let i = left; ascending ? i < end : i > end; ascending ? i++ : i--) { + range.push(i); + } + range; + } }; - -function __range__(left, right, inclusive) { - let range = []; - let ascending = left < right; - let end = !inclusive ? right : ascending ? right + 1 : right - 1; - for (let i = left; ascending ? i < end : i > end; ascending ? i++ : i--) { - range.push(i); - } - return range; -} \ No newline at end of file +//# sourceMappingURL=client.js.map \ No newline at end of file diff --git a/spec/client.js.map b/spec/client.js.map new file mode 100644 index 00000000..329b172d --- /dev/null +++ b/spec/client.js.map @@ -0,0 +1 @@ +{"version":3,"file":"client.js","sourceRoot":"","sources":["../spec_src/client.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAEH,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAClC,qCAAwD;AAExD,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC5B,MAAM,IAAI,GA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KAAK,GAAG,CAAC,CAAA;QAChE,KAAK,IAAI,CAAC,GAAG,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE;YACvE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;SACd;QACD,KAAK,CAAA;IACP,CAAC;AACH,CAAC,CAAA"} \ No newline at end of file diff --git a/spec/eval.d.ts b/spec/eval.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/spec/eval.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/spec/eval.js b/spec/eval.js index f5ae7700..90389a35 100644 --- a/spec/eval.js +++ b/spec/eval.js @@ -1,87 +1,81 @@ +"use strict"; /* * decaffeinate suggestions: * DS102: Remove unnecessary code created because of implicit returns * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ -const juno = require('../lib/julia-client'); -const {client} = juno.connection; - -module.exports = function() { - - let editor = null; - - const command = (ed, c) => atom.commands.dispatch(atom.views.getView(ed), c); - - const waitsForClient = () => waitsFor(done => client.onceDone(done)); - - beforeEach(function() { - waitsForPromise(() => atom.workspace.open().then(ed => editor = ed)); - // editor = atom.workspace.buildTextEditor() - return runs(() => editor.setGrammar(atom.grammars.grammarForScopeName('source.julia'))); - }); - - it('can evaluate code', function() { - let spy; - client.handle({test: (spy = jasmine.createSpy())}); - editor.insertText('Atom.@rpc test()'); - command(editor, 'julia-client:run-block'); - waitsForClient(); - return runs(() => expect(spy).toHaveBeenCalled()); - }); - - describe('when an expression is evaluated', function() { - - let results = null; - - beforeEach(function() { - editor.insertText('2+2'); - return waitsForPromise(() => { - return juno.runtime.evaluation.eval().then(x => { return results = x; }); - }); +Object.defineProperty(exports, "__esModule", { value: true }); +const jasmine = require('jasmine'); +const jasmine_1 = require("jasmine"); +const juno = require("../lib/julia-client"); +const { client } = juno.connection; +module.exports = function () { + let editor = null; + const command = (ed, c) => atom.commands.dispatch(atom.views.getView(ed), c); + async function waitsForClient(done) { + client.onceDone(done); + } + jasmine_1.beforeEach(async function (done) { + await atom.workspace.open().then(ed => (editor = ed)); + // editor = atom.workspace.buildTextEditor() + await editor.setGrammar(atom.grammars.grammarForScopeName("source.julia")); + done(); }); - - it('retrieves the value of the expression', function() { - expect(results.length).toBe(1); - const view = juno.ui.views.render(results[0]); - return expect(view.innerText).toBe('4'); + jasmine_1.it("can evaluate code", function () { + let spy; + client.handle({ test: (spy = jasmine.createSpy()) }); + editor.insertText("Atom.@rpc test()"); + command(editor, "julia-client:run-block"); + waitsForClient(); + jasmine_1.expect(spy).toHaveBeenCalled(); }); - - return it('displays the result', function() { - const views = atom.views.getView(editor).querySelectorAll('.result'); - expect(views.length).toBe(1); - return expect(views[0].innerText).toBe('4'); + jasmine_1.describe("when an expression is evaluated", function () { + let results = null; + jasmine_1.beforeEach(async function (done) { + editor.insertText("2+2"); + await juno.runtime.evaluation.eval().then(x => { + (results = x); + done(); + }); + }); + jasmine_1.it("retrieves the value of the expression", function () { + jasmine_1.expect(results.length).toBe(1); + const view = juno.ui.views.render(results[0]); + jasmine_1.expect(view.innerText).toBe("4"); + }); + jasmine_1.it("displays the result", function () { + const views = atom.views.getView(editor).querySelectorAll(".result"); + jasmine_1.expect(views.length).toBe(1); + jasmine_1.expect(views[0].innerText).toBe("4"); + }); }); - }); - - return describe('completions', function() { - - const completionsData = () => ({ - editor, - bufferPosition: editor.getCursors()[0].getBufferPosition(), - scopeDescriptor: editor.getCursors()[0].getScopeDescriptor(), - prefix: editor.getText() + jasmine_1.describe("completions", function () { + const completionsData = () => ({ + editor, + bufferPosition: editor.getCursors()[0].getBufferPosition(), + scopeDescriptor: editor.getCursors()[0].getScopeDescriptor(), + prefix: editor.getText() + }); + const getSuggestions = function () { + const completions = require("../lib/runtime/completions"); + completions.getSuggestions(completionsData()); + }; + jasmine_1.describe("basic module completions", function () { + let completions = null; + jasmine_1.beforeEach(async function (done) { + editor.insertText("sin"); + await getSuggestions().then(cs => { + (completions = cs); + done(); + }); + }); + jasmine_1.it("retrieves completions", function () { + completions = completions.map(c => c.text); + jasmine_1.expect(completions).toContain("sin"); + jasmine_1.expect(completions).toContain("sincos"); + jasmine_1.expect(completions).toContain("sinc"); + }); + }); }); - - const getSuggestions = function() { - const completions = require('../lib/runtime/completions'); - return completions.getSuggestions(completionsData()); - }; - - return describe('basic module completions', function() { - - let completions = null; - - beforeEach(function() { - editor.insertText('sin'); - return waitsForPromise(() => getSuggestions().then(cs => completions = cs)); - }); - - return it('retrieves completions', function() { - completions = completions.map(c => c.text); - expect(completions).toContain('sin'); - expect(completions).toContain('sincos'); - return expect(completions).toContain('sinc'); - }); - }); - }); }; +//# sourceMappingURL=eval.js.map \ No newline at end of file diff --git a/spec/eval.js.map b/spec/eval.js.map new file mode 100644 index 00000000..021791be --- /dev/null +++ b/spec/eval.js.map @@ -0,0 +1 @@ +{"version":3,"file":"eval.js","sourceRoot":"","sources":["../spec_src/eval.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAEH,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAClC,qCAAwD;AAExD,MAAM,IAAI,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;AAC3C,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,CAAA;AAElC,MAAM,CAAC,OAAO,GAAG;IACf,IAAI,MAAM,GAAG,IAAI,CAAA;IAEjB,MAAM,OAAO,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IAE5E,KAAK,UAAU,cAAc,CAAC,IAAK;QACjC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC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CAAC,EAAE;oBAC7B,CAAC,WAAW,GAAG,EAAE,CAAC,CAAA;oBAClB,IAAI,EAAE,CAAA;gBACV,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;YAEF,YAAE,CAAC,uBAAuB,EAAE;gBAC1B,WAAW,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;gBAC1C,gBAAM,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;gBACpC,gBAAM,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAA;gBACvC,gBAAM,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;YACvC,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/spec/juno-spec.d.ts b/spec/juno-spec.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/spec/juno-spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/spec/juno-spec.js b/spec/juno-spec.js index 59f42148..02a00c7b 100644 --- a/spec/juno-spec.js +++ b/spec/juno-spec.js @@ -1,77 +1,76 @@ +"use strict"; /* * decaffeinate suggestions: * DS102: Remove unnecessary code created because of implicit returns * DS207: Consider shorter variations of null checks * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ -const juno = require('../lib/julia-client'); -const {client} = juno.connection; - -if (process.platform === 'darwin') { - process.env.PATH += ':/usr/local/bin'; +Object.defineProperty(exports, "__esModule", { value: true }); +const jasmine = require('jasmine'); +const jasmine_1 = require("jasmine"); +const juno = require("../lib/julia-client"); +const { client } = juno.connection; +if (process.platform === "darwin") { + process.env.PATH += ":/usr/local/bin"; +} +async function basicSetup() { + jasmine.attachToDOM(atom.views.getView(atom.workspace)); + await atom.packages.activatePackage("language-julia"); + await atom.packages.activatePackage("ink"); + await atom.packages.activatePackage("julia-client"); + await atom.config.set("julia-client", { + juliaPath: "julia", + juliaOptions: { + bootMode: "Basic", + optimisationLevel: 2, + deprecationWarnings: false + }, + consoleOptions: { + rendererType: true + } + }); +} +async function cyclerSetup() { + await basicSetup(); + await atom.config.set("julia-client.juliaOptions.bootMode", "Cycler"); } - -const basicSetup = function() { - jasmine.attachToDOM(atom.views.getView(atom.workspace)); - waitsForPromise(() => atom.packages.activatePackage('language-julia')); - waitsForPromise(() => atom.packages.activatePackage('ink')); - waitsForPromise(() => atom.packages.activatePackage('julia-client')); - return runs(() => atom.config.set('julia-client', { - juliaPath: 'julia', - juliaOptions: { - bootMode: 'Basic', - optimisationLevel: 2, - deprecationWarnings: false - }, - consoleOptions: { - rendererType: true - } - } - )); -}; - -const cyclerSetup = function() { - basicSetup(); - return runs(() => atom.config.set('julia-client.juliaOptions.bootMode', 'Cycler')); -}; - let conn = null; - -const withClient = () => beforeEach(function() { - if (conn != null) { - return client.attach(conn); - } -}); - -const testClient = require('./client'); -const testEval = require('./eval'); - -describe("managing a basic client", function() { - beforeEach(basicSetup); - return testClient(); +async function withClient() { + jasmine_1.beforeEach(async function () { + if (conn != null) { + await client.attach(conn); + } + }); +} +const testClient = require("./client"); +const testEval = require("./eval"); +jasmine_1.describe("managing a basic client", function () { + jasmine_1.beforeEach(basicSetup); + await testClient(); }); - -describe("interaction with client cycler", function() { - beforeEach(cyclerSetup); - return testClient(); +jasmine_1.describe("interaction with client cycler", function () { + jasmine_1.beforeEach(cyclerSetup); + await testClient(); }); - -describe("before use", function() { - beforeEach(basicSetup); - return it('boots the client', function() { - waitsFor(5*60*1000, done => juno.connection.boot().then(() => done())); - return runs(() => conn = client.conn); - }); +jasmine_1.describe("before use", function () { + jasmine_1.beforeEach(basicSetup); + jasmine_1.it("boots the client", function (done) { + setTimeout(function (done1) { + juno.connection.boot() + .then(() => done1()); + }, 5 * 60 * 1000); + conn = client.conn; + done(); + }); }); - -describe("in an editor", function() { - beforeEach(basicSetup); - withClient(); - return testEval(); +jasmine_1.describe("in an editor", function () { + jasmine_1.beforeEach(basicSetup); + withClient(); + testEval(); }); - -describe("after use", function() { - beforeEach(basicSetup); - withClient(); - return it("kills the client", () => client.kill()); +jasmine_1.describe("after use", function () { + jasmine_1.beforeEach(basicSetup); + withClient(); + jasmine_1.it("kills the client", () => client.kill()); }); +//# sourceMappingURL=juno-spec.js.map \ No newline at end of file diff --git a/spec/juno-spec.js.bak b/spec/juno-spec.js.bak deleted file mode 100644 index 6449e972..00000000 --- a/spec/juno-spec.js.bak +++ /dev/null @@ -1,68 +0,0 @@ -const juno = require('../lib/julia-client') -const path = require('path') -const {client} = juno.connection - -function loadDependencies () { - waitsForPromise(() => atom.packages.activatePackage('language-julia')) - waitsForPromise(() => atom.packages.activatePackage('ink')) - waitsForPromise(() => atom.packages.activatePackage('julia-client')) - runs(() => { - atom.config.set('julia-client.juliaPath', 'julia') - atom.config.set('julia-client.juliaOptions', { - bootMode: 'Basic', - optimisationLevel: 2, - deprecationWarnings: false, - } - ) - }) -} - -describe("before booting", function () { - let checkPath = p => juno.misc.paths.getVersion(p) - - beforeEach(loadDependencies) - it("can validate an existing julia binary", () => { - waitsFor(done => { - checkPath("julia").then(() => done()) - }) - }) - it("can not validate a not existing julia binary", () => { - waitsFor(done => { - checkPath("imprettysureimnotjulia").catch(() => done()) - }) - }) -}) -function clientStatus () { - return [client.isActive(), client.isWorking()] -} -let {echo, evalsimple} = client.import(['echo', 'evalsimple']) - -describe("managing a basic client", function () { - beforeEach(loadDependencies) - describe("when booting the client", function () { - it("recognises the client's state before boot", () => { - expect(clientStatus()).toEqual([false, false]) - }) - - it("boots a julia process", () => { - let pingpong = client.import('ping') - waitsFor("the boot process to complete", 5*60*1000, (done) => { - console.log(client); - juno.connection.boot().then(() => { - expect(clientStatus()).toEqual([true, true]) - pingpong().then(val => { - expect(val).toBe('pong') - done() - }) - }) - }) - runs(() => { - conn = client.conn - }) - }) - - it("recognises the client's state after boot", () => { - expect(clientStatus()).toEqual([true, false]) - }) - }) -}) diff --git a/spec/juno-spec.js.map b/spec/juno-spec.js.map new file mode 100644 index 00000000..2e2a187e --- /dev/null +++ b/spec/juno-spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"juno-spec.js","sourceRoot":"","sources":["../spec_src/juno-spec.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAClC,qCAAwD;AAExD,MAAM,IAAI,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;AAC3C,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,CAAA;AAElC,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE;IACjC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,iBAAiB,CAAA;CACtC;AAED,KAAK,UAAU,UAAU;IACvB,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAA;IACvD,MAAM,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAAA;IACrD,MAAM,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,CAAA;IAC1C,MAAM,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,cAAc,CAAC,CAAA;IACnD,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE;QACpC,SAAS,EAAE,OAAO;QAClB,YAAY,EAAE;YACZ,QAAQ,EAAE,OAAO;YACjB,iBAAiB,EAAE,CAAC;YACpB,mBAAmB,EAAE,KAAK;SAC3B;QACD,cAAc,EAAE;YACd,YAAY,EAAE,IAAI;SACnB;KACF,CAAC,CAAA;AACJ,CAAC;AAED,KAAK,UAAU,WAAW;IACxB,MAAM,UAAU,EAAE,CAAA;IAClB,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG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oBAAU,CAAC,UAAU,CAAC,CAAA;IACtB,UAAU,EAAE,CAAA;IACZ,YAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAA;AAC7C,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/spec/runner.d.ts b/spec/runner.d.ts new file mode 100644 index 00000000..5298df7f --- /dev/null +++ b/spec/runner.d.ts @@ -0,0 +1,2 @@ +declare const _default: any; +export default _default; diff --git a/spec/runner.js b/spec/runner.js new file mode 100644 index 00000000..63e65df2 --- /dev/null +++ b/spec/runner.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const atom_jasmine3_test_runner_1 = require("atom-jasmine3-test-runner"); +// https://github.com/UziTech/atom-jasmine3-test-runner#api +exports.default = atom_jasmine3_test_runner_1.createRunner({ + timeReporter: true, + specHelper: true, + testPackages: ["language-julia", "ink"] +}); +//# sourceMappingURL=runner.js.map \ No newline at end of file diff --git a/spec/runner.js.map b/spec/runner.js.map new file mode 100644 index 00000000..9610099b --- /dev/null +++ b/spec/runner.js.map @@ -0,0 +1 @@ +{"version":3,"file":"runner.js","sourceRoot":"","sources":["../spec_src/runner.ts"],"names":[],"mappings":";;AAAA,yEAAwD;AAExD,2DAA2D;AAC3D,kBAAe,wCAAY,CAAC;IAC1B,YAAY,EAAG,IAAI;IACnB,UAAU,EAAE,IAAI;IAChB,YAAY,EAAE,CAAC,gBAAgB,EAAE,KAAK,CAAC;CACxC,CAAC,CAAA"} \ No newline at end of file diff --git a/spec/tsconfig.tsbuildinfo b/spec/tsconfig.tsbuildinfo new file mode 100644 index 00000000..df8e21a9 --- /dev/null +++ b/spec/tsconfig.tsbuildinfo @@ -0,0 +1,3 @@ +{ + "version": "3.8.3" +} \ No newline at end of file diff --git a/spec_src/client.ts b/spec_src/client.ts new file mode 100644 index 00000000..91907cbb --- /dev/null +++ b/spec_src/client.ts @@ -0,0 +1,164 @@ +/* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * DS205: Consider reworking code to avoid use of IIFEs + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md + */ + +const jasmine = require('jasmine') +import {describe, beforeEach, it, expect} from 'jasmine' + +const path = require("path") +const juno = require("../lib/julia-client") + +const { client } = juno.connection + +module.exports = function() { + const clientStatus = () => [client.isActive(), client.isWorking()] + const { echo, evalsimple } = client.import(["echo", "evalsimple"]) + + describe("before booting", function() { + const checkPath = p => juno.misc.paths.getVersion(p) + + it("can invalidate a non-existant julia binary", () => + it("", done => checkPath(path.join(__dirname, "foobar")).catch(() => done()))) + + it("can validate a julia command", () => it("", done => checkPath("julia").then(() => done()))) + + it("can invalidate a non-existant julia command", () => it("", done => checkPath("nojulia").catch(() => done()))) + }) + + let conn = null + beforeEach(function() { + if (conn != null) { + client.attach(conn) + } + }) + + describe("when booting the client", function() { + it("recognises the client's state before boot", () => expect(clientStatus()).toEqual([false, false])) + + it("initiates the boot", async function() { + await juno.connection.local.start() + conn = client.conn + }) + + it("waits for the boot to complete", function() { + const pong = client.import("ping")() + expect(clientStatus()).toEqual([true, true]) + it( + "the client to boot", + setTimeout(done => { + pong.then(function(pong) { + expect(pong).toBe("pong") + done() + }) + }, 5 * 60 * 1000) + ) + }) + + // it "recognises the client's state after boot", -> + // expect(clientStatus()).toEqual [true, false] + + describe("while the client is active", function() { + it("can send and receive nested objects, strings and arrays", async function() { + const msg = { x: 1, y: [1, 2, 3], z: "foo" } + return await (() => echo(msg).then(response => expect(response).toEqual(msg))) + }) + + it("can evaluate code and return the result", function() { + const remote = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map(x => evalsimple(`${x}^2`)) + return Promise.all(remote).then(remote => + expect(remote).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map(x => Math.pow(x, 2)) + )) + }) + + it("can rpc into the frontend", function() { + let x + client.handle({ + test(x) { + Math.pow(x, 2) + } + }) + const remote = (() => { + let i + const result = [] + for (i = 1, x = i; i <= 10; i++, x = i) { + result.push(evalsimple(`Atom.@rpc test(${x})`)) + } + result + })() + Promise.all(remote).then(remote => + expect(remote).toEqual( + (() => { + const result1 = [] + for (x = 1; x <= 10; x++) { + result1.push(Math.pow(x, 2)) + } + result1 + })() + ) + ) + }) + + it("can retrieve promise values from the frontend", async function(done) { + client.handle({ + test(x) { + Promise.resolve(x) + } + }) + await evalsimple("Atom.@rpc test(2)").then(x => expect(x).toBe(2)) + done() + }) + + describe("when using callbacks", function() { + let { cbs, workingSpy, doneSpy } = {} + + beforeEach(function() { + client.onWorking((workingSpy = jasmine.createSpy("working"))) + client.onDone((doneSpy = jasmine.createSpy("done")))( + (cbs = [1, 2, 3, 4, 5].map(i => evalsimple("peakflops(100)"))) + ) + }) + + it("enters loading state", () => expect(client.isWorking()).toBe(true)) + + // it "emits a working event", -> + // expect(workingSpy.calls.length).toBe(1) + + it("isn't done yet", () => expect(doneSpy).not.toHaveBeenCalled()) + + describe("when they finish", function() { + beforeEach(() => setTimeout(done => Promise.all(cbs).then(done)), 10 * 1000) + + it("stops loading after they are done", () => expect(client.isWorking()).toBe(false)) + + it("emits a done event", () => expect(doneSpy.calls.length).toBe(1)) + }) + }) + + it("can handle a large number of concurrent callbacks", async function() { + const n = 100 + const cbs = __range__(0, n, false).map(i => evalsimple(`sleep(rand()); ${i}^2`)) + await Promise.all(cbs).then(xs => expect(xs).toEqual(__range__(0, n, false).map(x => Math.pow(x, 2)))) + }) + }) + + it("handles shutdown correctly", function() { + it("", done => evalsimple("exit()").catch(() => done())) + expect(client.isWorking()).toBe(false) + expect(clientStatus()).toEqual([false, false]) + }) + }) + + function __range__(left, right, inclusive) { + let range = [] + let ascending = left < right + let end = !inclusive ? right : ascending ? right + 1 : right - 1 + for (let i = left; ascending ? i < end : i > end; ascending ? i++ : i--) { + range.push(i) + } + range + } +} diff --git a/spec_src/eval.ts b/spec_src/eval.ts new file mode 100644 index 00000000..e0730268 --- /dev/null +++ b/spec_src/eval.ts @@ -0,0 +1,94 @@ +/* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md + */ + +const jasmine = require('jasmine') +import {describe, beforeEach, it, expect} from 'jasmine' + +const juno = require("../lib/julia-client") +const { client } = juno.connection + +module.exports = function() { + let editor = null + + const command = (ed, c) => atom.commands.dispatch(atom.views.getView(ed), c) + + async function waitsForClient(done?) { + client.onceDone(done) + } + + beforeEach(async function(done) { + await atom.workspace.open().then(ed => (editor = ed)) + // editor = atom.workspace.buildTextEditor() + await editor.setGrammar(atom.grammars.grammarForScopeName("source.julia")) + done() + }) + + it("can evaluate code", function() { + let spy + client.handle({ test: (spy = jasmine.createSpy()) }) + editor.insertText("Atom.@rpc test()") + command(editor, "julia-client:run-block") + waitsForClient() + expect(spy).toHaveBeenCalled() + }) + + describe("when an expression is evaluated", function() { + let results = null + + beforeEach(async function(done) { + editor.insertText("2+2") + await juno.runtime.evaluation.eval().then(x => { + (results = x) + done() + }) + }) + + it("retrieves the value of the expression", function() { + expect(results.length).toBe(1) + const view = juno.ui.views.render(results[0]) + expect(view.innerText).toBe("4") + }) + + it("displays the result", function() { + const views = atom.views.getView(editor).querySelectorAll(".result") + expect(views.length).toBe(1) + expect(views[0].innerText).toBe("4") + }) + }) + + describe("completions", function() { + const completionsData = () => ({ + editor, + bufferPosition: editor.getCursors()[0].getBufferPosition(), + scopeDescriptor: editor.getCursors()[0].getScopeDescriptor(), + prefix: editor.getText() + }) + + const getSuggestions = function() { + const completions = require("../lib/runtime/completions") + completions.getSuggestions(completionsData()) + } + + describe("basic module completions", function() { + let completions = null + + beforeEach(async function(done) { + editor.insertText("sin") + await getSuggestions().then(cs => { + (completions = cs) + done() + }) + }) + + it("retrieves completions", function() { + completions = completions.map(c => c.text) + expect(completions).toContain("sin") + expect(completions).toContain("sincos") + expect(completions).toContain("sinc") + }) + }) + }) +} diff --git a/spec_src/juno-spec.ts b/spec_src/juno-spec.ts new file mode 100644 index 00000000..05dcd26f --- /dev/null +++ b/spec_src/juno-spec.ts @@ -0,0 +1,86 @@ +/* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md + */ + +const jasmine = require('jasmine') +import {describe, beforeEach, it} from 'jasmine' + +const juno = require("../lib/julia-client") +const { client } = juno.connection + +if (process.platform === "darwin") { + process.env.PATH += ":/usr/local/bin" +} + +async function basicSetup() { + jasmine.attachToDOM(atom.views.getView(atom.workspace)) + await atom.packages.activatePackage("language-julia") + await atom.packages.activatePackage("ink") + await atom.packages.activatePackage("julia-client") + await atom.config.set("julia-client", { + juliaPath: "julia", + juliaOptions: { + bootMode: "Basic", + optimisationLevel: 2, + deprecationWarnings: false + }, + consoleOptions: { + rendererType: true + } + }) +} + +async function cyclerSetup() { + await basicSetup() + await atom.config.set("julia-client.juliaOptions.bootMode", "Cycler") +} + +let conn = null + +async function withClient() { + beforeEach(async function() { + if (conn != null) { + await client.attach(conn) + } + }) +} + +const testClient = require("./client") +const testEval = require("./eval") + +describe("managing a basic client", function() { + beforeEach(basicSetup) + await testClient() +}) + +describe("interaction with client cycler", function() { + beforeEach(cyclerSetup) + await testClient() +}) + +describe("before use", function() { + beforeEach(basicSetup) + it("boots the client", function(done) { + setTimeout(function(done1){ + juno.connection.boot() + .then(() => done1()) + }, 5*60*1000) + conn = client.conn + done() + }) +}) + +describe("in an editor", function() { + beforeEach(basicSetup) + withClient() + testEval() +}) + +describe("after use", function() { + beforeEach(basicSetup) + withClient() + it("kills the client", () => client.kill()) +}) diff --git a/spec_src/runner.ts b/spec_src/runner.ts new file mode 100644 index 00000000..41baa4a6 --- /dev/null +++ b/spec_src/runner.ts @@ -0,0 +1,8 @@ +import { createRunner } from "atom-jasmine3-test-runner" + +// https://github.com/UziTech/atom-jasmine3-test-runner#api +export default createRunner({ + timeReporter : true, + specHelper: true, + testPackages: ["language-julia", "ink"] +}) diff --git a/spec_src/tsconfig.json b/spec_src/tsconfig.json new file mode 100644 index 00000000..bf35ed8e --- /dev/null +++ b/spec_src/tsconfig.json @@ -0,0 +1,37 @@ +{ + "compilerOptions": { + //// Linting Options - Uncomment options to get more features (usually more restrictive) + // "strict": true, // includes all of the following and more + "strictNullChecks": true, + // "forceConsistentCasingInFileNames": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noImplicitAny": true, + // "noImplicitThis": true, + "noFallthroughCasesInSwitch": true, + "allowJs": true, + //// Compilation options + "declaration": true, + "emitDecoratorMetadata": true, + "esModuleInterop": true, + "experimentalDecorators": true, + "incremental": true, + // "inlineSourceMap": false, + // "preserveConstEnums": true, + "sourceMap": true, + "preserveSymlinks": true, + // "removeComments": true, + // "jsx": "react", + // "jsxFactory": "etch.dom", + "lib": ["ES2018", "dom"], + "target": "ES2018", + "module": "commonjs", + "moduleResolution": "node", + // "noLib": false, + // "importHelpers": true, // if true you should add tslib to deps + // "skipLibCheck": false, + "outDir": "../spec" + }, + "compileOnSave": true +} diff --git a/spec_src/tslint.json b/spec_src/tslint.json new file mode 100644 index 00000000..d03e0eea --- /dev/null +++ b/spec_src/tslint.json @@ -0,0 +1,22 @@ +{ + "defaultSeverity": "error", + "extends": [ + "tslint:recommended" + ], + "jsRules": {}, + "rules": { + "array-type": false, + "no-consecutive-blank-lines": false, + "only-arrow-functions": false, + "no-console": false, + + "semicolon": false, + "whitespace": false, + "no-trailing-whitespace": false, + "curly": false, + "variable-name": false, + "arrow-parens": false, + "object-literal-shorthand": false + }, + "rulesDirectory": [] +}