Skip to content

Commit

Permalink
bump wollok version + fix filename validation error
Browse files Browse the repository at this point in the history
  • Loading branch information
ivojawer committed Jun 6, 2024
1 parent 557709b commit 5573dec
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 16 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/commands/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }')
const drawDefinition = () => parse.File('draw.wlk').tryParse('object drawer{ method apply() native }')
12 changes: 10 additions & 2 deletions test/run.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -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', () => {
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -221,6 +227,8 @@ describe('testing run', () => {
game: true,
startDiagram: true,
assets,
host: 'localhost',
port: '3000',
})
await clock.runAllAsync()
})
Expand Down
5 changes: 3 additions & 2 deletions test/test.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ describe('Test', () => {

const emptyOptions = {
project: projectPath,
skipValidations: false,
skipValidations: true,
file: undefined,
describe: undefined,
test: undefined,
Expand Down Expand Up @@ -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'),
})

Expand Down

0 comments on commit 5573dec

Please sign in to comment.