diff --git a/package-lock.json b/package-lock.json index 6889444..83069a3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wollok-ts-cli", - "version": "0.2.2", + "version": "0.2.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "wollok-ts-cli", - "version": "0.2.2", + "version": "0.2.3", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -21,7 +21,7 @@ "pkg": "^5.8.1", "socket.io": "^4.5.1", "winston": "^3.11.0", - "wollok-ts": "4.1.0" + "wollok-ts": "4.1.1" }, "bin": { "wollok": "build/src/index.js" @@ -6203,9 +6203,9 @@ } }, "node_modules/wollok-ts": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/wollok-ts/-/wollok-ts-4.1.0.tgz", - "integrity": "sha512-qAdBR7nHIK6daPW8a3v42+Ii0lHaMd1jxasUUwAPSSYysEoPBnT+0ruH6yK4Byjv2Rn4b4t0ppnkIC9/UOdkyQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/wollok-ts/-/wollok-ts-4.1.1.tgz", + "integrity": "sha512-pALSw4ojwhn2yjOcf6pPr1ujGjUOigD6saSLLl0EWAjcIO3rwhaxqSkpGs/P3CtJk8F8zu8LRtpgNX2K+7mTBQ==", "dependencies": { "@types/parsimmon": "^1.10.8", "parsimmon": "^1.18.1", @@ -10785,9 +10785,9 @@ } }, "wollok-ts": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/wollok-ts/-/wollok-ts-4.1.0.tgz", - "integrity": "sha512-qAdBR7nHIK6daPW8a3v42+Ii0lHaMd1jxasUUwAPSSYysEoPBnT+0ruH6yK4Byjv2Rn4b4t0ppnkIC9/UOdkyQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/wollok-ts/-/wollok-ts-4.1.1.tgz", + "integrity": "sha512-pALSw4ojwhn2yjOcf6pPr1ujGjUOigD6saSLLl0EWAjcIO3rwhaxqSkpGs/P3CtJk8F8zu8LRtpgNX2K+7mTBQ==", "requires": { "@types/parsimmon": "^1.10.8", "parsimmon": "^1.18.1", diff --git a/package.json b/package.json index 425dd45..106d2e4 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "pkg": "^5.8.1", "socket.io": "^4.5.1", "winston": "^3.11.0", - "wollok-ts": "4.1.0" + "wollok-ts": "4.1.1" }, "devDependencies": { "@types/chai": "^4.3.9", diff --git a/src/commands/run.ts b/src/commands/run.ts index 3eb8c45..18a22aa 100644 --- a/src/commands/run.ts +++ b/src/commands/run.ts @@ -15,7 +15,7 @@ import { logger as fileLogger } from '../logger' const { time, timeEnd } = console -type Options = { +export type Options = { project: string assets: string skipValidations: boolean @@ -291,4 +291,4 @@ export const gameHost = (host: string): string => host ?? DEFAULT_HOST export const dynamicDiagramPort = (port: string): string => `${+gamePort(port) + 1}` -const drawDefinition = () => parse.File('draw').tryParse('object drawer{ method apply() native }') \ No newline at end of file +const drawDefinition = () => parse.File('draw.wlk').tryParse('object drawer{ method apply() native }') \ No newline at end of file diff --git a/test/run.test.ts b/test/run.test.ts index f3b4e51..9533ae7 100644 --- a/test/run.test.ts +++ b/test/run.test.ts @@ -2,7 +2,7 @@ import chai from 'chai' import { mkdirSync, rmdirSync } from 'fs' import { join } from 'path' import sinon from 'sinon' -import run, { buildEnvironmentForProgram, getAssetsFolder, getGameInterpreter, getImages, getSoundsFolder, getVisuals, initializeGameClient } from '../src/commands/run' +import run, { Options, buildEnvironmentForProgram, getAssetsFolder, getGameInterpreter, getImages, getSoundsFolder, getVisuals, initializeGameClient } from '../src/commands/run' import { spyCalledWithSubstring } from './assertions' import { logger as fileLogger } from '../src/logger' @@ -14,12 +14,14 @@ const assets = 'assets' describe('testing run', () => { - const buildOptions = (game: boolean, assets: string) => ({ + const buildOptions = (game: boolean, assets: string): Options => ({ game, project, assets, skipValidations: false, startDiagram: false, + host: 'localhost', + port: '3000', }) describe('getAssetsPath', () => { @@ -171,6 +173,8 @@ describe('testing run', () => { game: false, startDiagram: false, assets, + host: 'localhost', + port: '3000', }) expect(spyCalledWithSubstring(consoleLogSpy, 'Pepita empieza con 70')).to.be.true expect(spyCalledWithSubstring(consoleLogSpy, 'Vuela')).to.be.true @@ -191,6 +195,8 @@ describe('testing run', () => { game: false, startDiagram: false, assets, + host: 'localhost', + port: '3000', }) expect(processExitSpy.calledWith(21)).to.be.true expect(fileLoggerInfoSpy.calledOnce).to.be.true @@ -221,6 +227,8 @@ describe('testing run', () => { game: true, startDiagram: true, assets, + host: 'localhost', + port: '3000', }) await clock.runAllAsync() }) diff --git a/test/test.test.ts b/test/test.test.ts index bcc552a..a7a2f96 100644 --- a/test/test.test.ts +++ b/test/test.test.ts @@ -271,7 +271,7 @@ describe('Test', () => { const emptyOptions = { project: projectPath, - skipValidations: false, + skipValidations: true, file: undefined, describe: undefined, test: undefined, @@ -314,9 +314,10 @@ describe('Test', () => { expect(fileLoggerArg.failures.length).to.equal(1) }) - it('returns exit code 1 if tests throw an error', async () => { + it('returns exit code 1 if tests has parse errors', async () => { await test(undefined, { ...emptyOptions, + skipValidations: false, project: join('examples', 'test-examples', 'failing-case'), })