Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mojiscript",
"version": "0.5.1",
"version": "0.6.0",
"description": "MojiScript is an Async First, opinionated, and functional language designed to have 100% compatibility with JavaScript engines.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion type/Just.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function Just(value) {
const toString = () => `Just (${value})`
const toString = () => `Just (${JSON.stringify(value)})`
const map = func => Just(func(value))

return Object.freeze({
Expand Down
9 changes: 8 additions & 1 deletion type/__tests__/Just.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,20 @@ describe('type/Just', () => {
expect(actual).toBe(expected)
})

test('toString', () => {
test('Just(888).toString', () => {
expect.assertions(1)
const expected = 'Just (888)'
const actual = Just(888).toString()
expect(actual).toBe(expected)
})

test('Just(abc).toString', () => {
expect.assertions(1)
const expected = 'Just ("abc")'
const actual = Just('abc').toString()
expect(actual).toBe(expected)
})

test('@@type', () => {
expect.assertions(1)
const expected = Just['@@type']
Expand Down