Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacasonato committed Jan 24, 2024
1 parent e221559 commit 2eae8a6
Show file tree
Hide file tree
Showing 2 changed files with 234 additions and 0 deletions.
115 changes: 115 additions & 0 deletions tests/specs/graph/JsrSpecifiers_FastCheck_VarArrowLeavable.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# https://jsr.io/@scope/a/meta.json
{"versions": { "1.0.0": {} } }

# https://jsr.io/@scope/a/1.0.0_meta.json
{ "exports": { ".": "./mod.ts" } }

# https://jsr.io/@scope/a/1.0.0/mod.ts
import type { Foo, Bar } from "./b.ts";

export const foo = (foo: Foo): string => "test";
export const bar = (): Bar => new Bar();

# https://jsr.io/@scope/a/1.0.0/b.ts
export type Foo = string;
export class Bar {}

# mod.ts
import 'jsr:@scope/a'

# output
{
"roots": [
"file:///mod.ts"
],
"modules": [
{
"kind": "esm",
"dependencies": [
{
"specifier": "jsr:@scope/a",
"code": {
"specifier": "jsr:@scope/a",
"span": {
"start": {
"line": 0,
"character": 7
},
"end": {
"line": 0,
"character": 21
}
}
}
}
],
"size": 22,
"mediaType": "TypeScript",
"specifier": "file:///mod.ts"
},
{
"kind": "esm",
"size": 46,
"mediaType": "TypeScript",
"specifier": "https://jsr.io/@scope/a/1.0.0/b.ts"
},
{
"kind": "esm",
"dependencies": [
{
"specifier": "./b.ts",
"type": {
"specifier": "https://jsr.io/@scope/a/1.0.0/b.ts",
"span": {
"start": {
"line": 0,
"character": 30
},
"end": {
"line": 0,
"character": 38
}
}
}
}
],
"size": 131,
"mediaType": "TypeScript",
"specifier": "https://jsr.io/@scope/a/1.0.0/mod.ts"
}
],
"redirects": {
"jsr:@scope/a": "https://jsr.io/@scope/a/1.0.0/mod.ts"
},
"packages": {
"@scope/a": "@scope/a@1.0.0"
}
}

Fast check https://jsr.io/@scope/a/1.0.0/b.ts:
{}
export type Foo = string;
export class Bar {
}

Fast check https://jsr.io/@scope/a/1.0.0/mod.ts:
{
"./b.ts": {
"type": {
"specifier": "https://jsr.io/@scope/a/1.0.0/b.ts",
"span": {
"start": {
"line": 0,
"character": 30
},
"end": {
"line": 0,
"character": 38
}
}
}
}
}
import type { Foo, Bar } from "./b.ts";
export const foo = (foo: Foo): string =>({} as any);
export const bar = (): Bar =>({} as any);
119 changes: 119 additions & 0 deletions tests/specs/graph/JsrSpecifiers_FastCheck_VarFunctionLeavable.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# https://jsr.io/@scope/a/meta.json
{"versions": { "1.0.0": {} } }

# https://jsr.io/@scope/a/1.0.0_meta.json
{ "exports": { ".": "./mod.ts" } }

# https://jsr.io/@scope/a/1.0.0/mod.ts
import type { Foo, Bar } from "./b.ts";

export const foo = function(foo: Foo): string { return "test" };
export const bar = function (): Bar { return new Bar() };

# https://jsr.io/@scope/a/1.0.0/b.ts
export type Foo = string;
export class Bar {}

# mod.ts
import 'jsr:@scope/a'

# output
{
"roots": [
"file:///mod.ts"
],
"modules": [
{
"kind": "esm",
"dependencies": [
{
"specifier": "jsr:@scope/a",
"code": {
"specifier": "jsr:@scope/a",
"span": {
"start": {
"line": 0,
"character": 7
},
"end": {
"line": 0,
"character": 21
}
}
}
}
],
"size": 22,
"mediaType": "TypeScript",
"specifier": "file:///mod.ts"
},
{
"kind": "esm",
"size": 46,
"mediaType": "TypeScript",
"specifier": "https://jsr.io/@scope/a/1.0.0/b.ts"
},
{
"kind": "esm",
"dependencies": [
{
"specifier": "./b.ts",
"type": {
"specifier": "https://jsr.io/@scope/a/1.0.0/b.ts",
"span": {
"start": {
"line": 0,
"character": 30
},
"end": {
"line": 0,
"character": 38
}
}
}
}
],
"size": 164,
"mediaType": "TypeScript",
"specifier": "https://jsr.io/@scope/a/1.0.0/mod.ts"
}
],
"redirects": {
"jsr:@scope/a": "https://jsr.io/@scope/a/1.0.0/mod.ts"
},
"packages": {
"@scope/a": "@scope/a@1.0.0"
}
}

Fast check https://jsr.io/@scope/a/1.0.0/b.ts:
{}
export type Foo = string;
export class Bar {
}

Fast check https://jsr.io/@scope/a/1.0.0/mod.ts:
{
"./b.ts": {
"type": {
"specifier": "https://jsr.io/@scope/a/1.0.0/b.ts",
"span": {
"start": {
"line": 0,
"character": 30
},
"end": {
"line": 0,
"character": 38
}
}
}
}
}
import type { Foo, Bar } from "./b.ts";
export const foo = function(foo: Foo): string {
return {} as any;
};
export const bar = function(): Bar {
return {} as any;
};

0 comments on commit 2eae8a6

Please sign in to comment.