Skip to content

Commit

Permalink
upgrade wollok-ts to 4.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ivojawer committed Jun 19, 2024
1 parent c023d06 commit 7bb087a
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
object pepita {
var energia = 0
var extra = 0

// method without parentheses does not parse ok
method energiaTotal = energia + extra
}
// the actual file doesnt matter since it isnt actually built (stubbed)
14 changes: 7 additions & 7 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.1"
"wollok-ts": "4.1.2"
},
"devDependencies": {
"@types/chai": "^4.3.9",
Expand Down
5 changes: 5 additions & 0 deletions test/fullRepl.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Interface } from 'readline'
import sinon from 'sinon'
import { ENTER } from '../src/utils'
import { spyCalledWithSubstring } from './assertions'
import * as wollok from 'wollok-ts'

chai.should()
chai.use(chaiHttp)
Expand All @@ -16,6 +17,7 @@ const expect = chai.expect
const baseOptions = {
darkMode: true,
port: '8080',
host: 'localhost',
skipDiagram: true,
}

Expand All @@ -39,6 +41,7 @@ describe('REPL integration test for valid project', () => {
project: projectPath,
skipValidations: false,
darkMode: true,
host: 'localhost',
port: '8080',
skipDiagram: false,
}
Expand Down Expand Up @@ -86,6 +89,8 @@ describe('REPL integration test for invalid project', () => {
})

it('should return exit code 12 if project has parse errors', async () => {
sinon.stub(wollok, 'buildEnvironment').throws(new Error('Failed to parse fileWithParseErrors.wlk'))

await expect(callRepl('fileWithParseErrors.wlk', buildOptionsFor('parse-errors'))).to.eventually.be.rejectedWith(/exit with 12 error code/)
})

Expand Down
1 change: 1 addition & 0 deletions test/repl.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ describe('REPL', () => {
skipValidations: false,
darkMode: true,
port: '8080',
host: 'localhost',
skipDiagram: false,
}
let interpreter: Interpreter
Expand Down
5 changes: 5 additions & 0 deletions test/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@ import chaiAsPromised from 'chai-as-promised'
import chai from 'chai'
import { spyCalledWithSubstring } from './assertions'
import { Problem, WOLLOK_EXTRA_STACK_TRACE_HEADER, validate, List } from 'wollok-ts'
import * as wollok from 'wollok-ts'

describe('build & validating environment', () => {

afterEach(() => {
sinon.restore()
})
const badProjectPath = join('examples', 'bad-files-examples')

it('should throw an exception if parsing fails', async () => {
chai.use(chaiAsPromised)
const expect = chai.expect
sinon.stub(wollok, 'buildEnvironment').throws(new Error('Failed to parse fileWithParseErrors.wlk'))
await expect(buildEnvironmentForProject(join(badProjectPath, 'parse-errors'), ['fileWithParseErrors.wlk'])).to.eventually.be.rejectedWith(/Failed to parse fileWithParseErrors.wlk/)
})

Expand Down

0 comments on commit 7bb087a

Please sign in to comment.