Skip to content

Commit

Permalink
test: rename tsconfigJsonString
Browse files Browse the repository at this point in the history
  • Loading branch information
privatenumber committed Jan 5, 2023
1 parent 10d6a0f commit 34715f3
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 115 deletions.
38 changes: 19 additions & 19 deletions tests/specs/create-paths-matcher.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { testSuite, expect } from 'manten';
import { createFixture } from 'fs-fixture';
import { tsconfigJson, getTscResolution } from '../utils.js';
import { tsconfigJsonString, getTscResolution } from '../utils.js';
import { getTsconfig, createPathsMatcher } from '#get-tsconfig';

/**
Expand All @@ -13,7 +13,7 @@ export default testSuite(({ describe }) => {
describe('error cases', ({ test }) => {
test('no baseUrl or paths', async () => {
const fixture = await createFixture({
'tsconfig.json': tsconfigJson({
'tsconfig.json': tsconfigJsonString({
compilerOptions: {},
}),
});
Expand All @@ -27,7 +27,7 @@ export default testSuite(({ describe }) => {

test('no baseUrl & non-relative paths', async () => {
const fixture = await createFixture({
'tsconfig.json': tsconfigJson({
'tsconfig.json': tsconfigJsonString({
compilerOptions: {
paths: {
'@': ['src'],
Expand All @@ -45,7 +45,7 @@ export default testSuite(({ describe }) => {

test('multiple * in pattern', async () => {
const fixture = await createFixture({
'tsconfig.json': tsconfigJson({
'tsconfig.json': tsconfigJsonString({
compilerOptions: {
paths: {
'a/*/*': ['src'],
Expand All @@ -63,7 +63,7 @@ export default testSuite(({ describe }) => {

test('multiple * in substitution', async () => {
const fixture = await createFixture({
'tsconfig.json': tsconfigJson({
'tsconfig.json': tsconfigJsonString({
compilerOptions: {
paths: {
'a/*': ['*/*'],
Expand All @@ -81,7 +81,7 @@ export default testSuite(({ describe }) => {

test('no match', async () => {
const fixture = await createFixture({
'tsconfig.json': tsconfigJson({
'tsconfig.json': tsconfigJsonString({
compilerOptions: {
paths: {
'no-match': ['./b'],
Expand All @@ -104,7 +104,7 @@ export default testSuite(({ describe }) => {

test('baseUrl', async () => {
const fixture = await createFixture({
'tsconfig.json': tsconfigJson({
'tsconfig.json': tsconfigJsonString({
compilerOptions: {
baseUrl: '.',
},
Expand All @@ -128,7 +128,7 @@ export default testSuite(({ describe }) => {
test('baseUrl from extends', async () => {
const fixture = await createFixture({
'src/lib/file': '',
'some-dir/tsconfig.json': tsconfigJson({
'some-dir/tsconfig.json': tsconfigJsonString({
compilerOptions: {
baseUrl: '..',
paths: {
Expand All @@ -141,7 +141,7 @@ export default testSuite(({ describe }) => {
},
},
}),
'tsconfig.json': tsconfigJson({
'tsconfig.json': tsconfigJsonString({
extends: './some-dir/tsconfig.json',
}),
});
Expand All @@ -162,7 +162,7 @@ export default testSuite(({ describe }) => {

test('exact match', async () => {
const fixture = await createFixture({
'tsconfig.json': tsconfigJson({
'tsconfig.json': tsconfigJsonString({
compilerOptions: {
paths: {
exactMatch: ['./b'],
Expand All @@ -188,7 +188,7 @@ export default testSuite(({ describe }) => {
// #17
test('exact match with parent path', async () => {
const fixture = await createFixture({
'tsconfig.json': tsconfigJson({
'tsconfig.json': tsconfigJsonString({
compilerOptions: {
paths: {
exactMatch: ['../src'],
Expand All @@ -214,7 +214,7 @@ export default testSuite(({ describe }) => {
test('exact match with literal wildcard', async () => {
const fixture = await createFixture({
'b/file': '',
'tsconfig.json': tsconfigJson({
'tsconfig.json': tsconfigJsonString({
compilerOptions: {
paths: {
exactMatch: ['./b/*'],
Expand All @@ -240,7 +240,7 @@ export default testSuite(({ describe }) => {
test('prefix match', async () => {
const fixture = await createFixture({
'prefixed/specifier': '',
'tsconfig.json': tsconfigJson({
'tsconfig.json': tsconfigJsonString({
compilerOptions: {
paths: {
'prefix-*': ['./prefixed/*'],
Expand All @@ -266,7 +266,7 @@ export default testSuite(({ describe }) => {
test('suffix match', async () => {
const fixture = await createFixture({
'suffixed/specifier': '',
'tsconfig.json': tsconfigJson({
'tsconfig.json': tsconfigJsonString({
compilerOptions: {
paths: {
'*-suffix': ['./suffixed/*'],
Expand All @@ -291,7 +291,7 @@ export default testSuite(({ describe }) => {

test('doesnt match current directory', async () => {
const fixture = await createFixture({
'tsconfig.json': tsconfigJson({
'tsconfig.json': tsconfigJsonString({
compilerOptions: {
paths: {
'.': ['./a'],
Expand All @@ -313,7 +313,7 @@ export default testSuite(({ describe }) => {

test('doesnt match parent directory', async () => {
const fixture = await createFixture({
'tsconfig.json': tsconfigJson({
'tsconfig.json': tsconfigJsonString({
compilerOptions: {
paths: {
'..': ['./a'],
Expand All @@ -335,7 +335,7 @@ export default testSuite(({ describe }) => {

test('doesnt match relative paths', async () => {
const fixture = await createFixture({
'tsconfig.json': tsconfigJson({
'tsconfig.json': tsconfigJsonString({
compilerOptions: {
paths: {
'./relative': ['./a'],
Expand All @@ -357,7 +357,7 @@ export default testSuite(({ describe }) => {

test('matches absolute paths', async () => {
const fixture = await createFixture({
'tsconfig.json': tsconfigJson({
'tsconfig.json': tsconfigJsonString({
compilerOptions: {
paths: {
'/absolute': ['./a'],
Expand All @@ -382,7 +382,7 @@ export default testSuite(({ describe }) => {

test('matches path that starts with .', async () => {
const fixture = await createFixture({
'tsconfig.json': tsconfigJson({
'tsconfig.json': tsconfigJsonString({
compilerOptions: {
paths: {
'.src': ['./src'],
Expand Down
Loading

0 comments on commit 34715f3

Please sign in to comment.