-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(builtin): fix linker issue when running test with "local" tag on …
…osx & linux (#1835)
- Loading branch information
1 parent
0d62b89
commit 98d3321
Showing
8 changed files
with
70 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
load("@npm_bazel_jasmine//:index.from_src.bzl", "jasmine_node_test") | ||
|
||
jasmine_node_test( | ||
name = "test", | ||
srcs = ["test.js"], | ||
tags = ["local"], | ||
templated_args = ["--nobazel_patch_module_resolver"], | ||
deps = ["//internal/linker/test/local/fit"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm") | ||
load("@npm//typescript:index.bzl", "tsc") | ||
|
||
tsc( | ||
name = "fit_lib", | ||
outs = [ | ||
"main.d.ts", | ||
"main.js", | ||
], | ||
args = [ | ||
"-p", | ||
"$(execpath tsconfig.json)", | ||
"--outDir", | ||
# $(RULEDIR) is a shorthand for the dist/bin directory where Bazel requires we write outputs | ||
"$(RULEDIR)", | ||
], | ||
data = [ | ||
"main.ts", | ||
"tsconfig.json", | ||
], | ||
) | ||
|
||
pkg_npm( | ||
name = "fit", | ||
package_name = "fit", | ||
srcs = ["package.json"], | ||
visibility = ["//internal/linker/test/local:__pkg__"], | ||
deps = [":fit_lib"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const fit: string = 'fit'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "fit", | ||
"main": "main.js", | ||
"typings": "main.d.ts" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"compilerOptions": { | ||
"declaration": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
describe('linker', () => { | ||
it('should work when job run with "local" tag', () => { | ||
const fit = require('fit'); | ||
expect(fit.fit).toBe('fit'); | ||
}); | ||
}); |