Skip to content

Commit

Permalink
feat: upgrade to latest loxia with improved JS generation
Browse files Browse the repository at this point in the history
  • Loading branch information
kollhof committed Dec 1, 2020
1 parent 2e8d952 commit 50568a1
Show file tree
Hide file tree
Showing 8 changed files with 783 additions and 755 deletions.
1,504 changes: 766 additions & 738 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
},
"devDependencies": {
"@fink/cli": "^8.2.0",
"@fink/larix": "^15.3.0",
"@fink/loxia": "^19.1.0",
"@fink/larix": "^18.0.0",
"@fink/loxia": "^21.1.0",
"commitizen": "^4.2.1",
"cz-conventional-changelog": "^3.3.0",
"jest-cli": "^26.5.3",
Expand All @@ -59,6 +59,6 @@
"dependencies": {
"@babel/core": "^7.11.6",
"@fink/js-interop": "^2.3.1",
"@fink/std-lib": "^7.0.0"
"@fink/std-lib": "^8.0.0"
}
}
2 changes: 1 addition & 1 deletion src/snapshot-resolver.fnk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ resolveSnapshotPath = fn test_path, snapshot_ext:


resolveTestPath = fn snaphot_path, snapshot_ext:
slice snaphot_path, 0, - length snapshot_ext
slice snaphot_path, 0, -length snapshot_ext


testPathForConsistencyCheck = 'some/tests/example.test.js'
4 changes: 2 additions & 2 deletions src/test.fnk
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ describe = describe_delegate jest_describe
it = it_delegate jest_it


skip = dict:
skip = rec:
describe: describe_delegate jest_describe.skip
it: it_delegate jest_it.skip


only = dict:
only = rec:
describe: describe_delegate jest_describe.only
it: it_delegate jest_it.only

Expand Down
2 changes: 1 addition & 1 deletion src/test.test.fnk
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mock_test = mock_fn fn: 'testing'


mock '@fink/test'
fn: dict:
fn: rec:
test: mock_test
{virtual: true}

Expand Down
14 changes: 7 additions & 7 deletions src/transform.fnk
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ babel_istanbul = import 'babel-plugin-istanbul'
istanbul_plugin = fn cwd, input_source_map:
list:
babel_istanbul
dict:
rec:
cwd
include: ['**/*.fnk']
extension: '.fnk'
Expand Down Expand Up @@ -48,8 +48,8 @@ is_imported = fn ident, name:


mock_plugin = fn:
dict:
visitor: dict:
rec:
visitor: rec:
CallExpression: fn path:
callee = path.get 'callee'
match callee:
Expand All @@ -65,8 +65,8 @@ mock_plugin = fn:


require_actual_plugin = fn:
dict:
visitor: dict:
rec:
visitor: rec:
CallExpression: fn path:
callee = path.get 'callee'
match callee:
Expand Down Expand Up @@ -98,7 +98,7 @@ handle_error = fn obj_with_errors:
transform = fn source, filename:
ast = parse source, filename
handle_error ast
opts = dict:
opts = rec:
module_type: 'cjs'
source_maps: true
import: {ext: {abs: '.js', rel: '.fnk'}}
Expand All @@ -117,7 +117,7 @@ process = fn src, filename, {rootDir}, transform_opts:
[mock_plugin, require_actual_plugin]


opts = dict:
opts = rec:
filename
sourceMap: true,
inputSourceMap: source_map
Expand Down
4 changes: 2 additions & 2 deletions src/transform.test.fnk
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe process, fn:
"
{it, mock, mock_fn, require_actual} = import '@fink/jest/test.fnk'

mock './transform.fnk', fn: dict:
mock './transform.fnk', fn: rec:
foobar: mock_fn _
shrub: require_actual './transform'

Expand Down Expand Up @@ -87,7 +87,7 @@ describe process, fn:
1| 123 foo
^

Expected `,` or indented new line or end of code."
Expected `,` or indented new line or end."


it 'handles loxia errors', fn:
Expand Down
2 changes: 1 addition & 1 deletion src/transform.test.fnk.snap
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ exports.foo = foo;",
"sourcesContent": Array [
"{it, mock, mock_fn, require_actual} = import '@fink/jest/test.fnk'
mock './transform.fnk', fn: dict:
mock './transform.fnk', fn: rec:
foobar: mock_fn _
shrub: require_actual './transform'
Expand Down

0 comments on commit 50568a1

Please sign in to comment.