Skip to content

Commit

Permalink
chore: rename import b/c this was bugging me
Browse files Browse the repository at this point in the history
  • Loading branch information
kanadgupta committed Jan 9, 2025
1 parent fbbffe4 commit 3bb8b15
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions __tests__/commands/changelogs/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fs from 'node:fs';
import path from 'node:path';

import chalk from 'chalk';
import frontMatter from 'gray-matter';
import grayMatter from 'gray-matter';
import nock from 'nock';
import { describe, beforeAll, afterAll, beforeEach, it, expect } from 'vitest';

Expand Down Expand Up @@ -52,14 +52,14 @@ describe('rdme changelogs', () => {
let fileContents = fs.readFileSync(path.join(fullFixturesDir, '/existing-docs/simple-doc.md'));
simpleDoc = {
slug: 'simple-doc',
doc: frontMatter(fileContents),
doc: grayMatter(fileContents),
hash: hashFileContents(fileContents),
};

fileContents = fs.readFileSync(path.join(fullFixturesDir, '/existing-docs/subdir/another-doc.md'));
anotherDoc = {
slug: 'another-doc',
doc: frontMatter(fileContents),
doc: grayMatter(fileContents),
hash: hashFileContents(fileContents),
};
});
Expand Down Expand Up @@ -189,7 +189,7 @@ describe('rdme changelogs', () => {
it('should create new changelog', async () => {
const slug = 'new-doc';
const id = '1234';
const doc = frontMatter(fs.readFileSync(path.join(fullFixturesDir, `/new-docs/${slug}.md`)));
const doc = grayMatter(fs.readFileSync(path.join(fullFixturesDir, `/new-docs/${slug}.md`)));
const hash = hashFileContents(fs.readFileSync(path.join(fullFixturesDir, `/new-docs/${slug}.md`)));

const getMock = getAPIv1Mock()
Expand Down Expand Up @@ -217,7 +217,7 @@ describe('rdme changelogs', () => {

it('should return creation info for dry run', async () => {
const slug = 'new-doc';
const doc = frontMatter(fs.readFileSync(path.join(fullFixturesDir, `/new-docs/${slug}.md`)));
const doc = grayMatter(fs.readFileSync(path.join(fullFixturesDir, `/new-docs/${slug}.md`)));

const getMock = getAPIv1Mock()
.get(`/api/v1/changelogs/${slug}`)
Expand Down Expand Up @@ -250,7 +250,7 @@ describe('rdme changelogs', () => {
help: "If you need help, email [email protected] and include the following link to your API log: 'fake-metrics-uuid'.",
};

const doc = frontMatter(fs.readFileSync(path.join(fullFixturesDir, `/${folder}/${slug}.md`)));
const doc = grayMatter(fs.readFileSync(path.join(fullFixturesDir, `/${folder}/${slug}.md`)));

const hash = hashFileContents(fs.readFileSync(path.join(fullFixturesDir, `/${folder}/${slug}.md`)));

Expand Down Expand Up @@ -289,7 +289,7 @@ describe('rdme changelogs', () => {
it('should use provided slug', async () => {
const slug = 'new-doc-slug';
const id = '1234';
const doc = frontMatter(fs.readFileSync(path.join(fullFixturesDir, `/slug-docs/${slug}.md`)));
const doc = grayMatter(fs.readFileSync(path.join(fullFixturesDir, `/slug-docs/${slug}.md`)));
const hash = hashFileContents(fs.readFileSync(path.join(fullFixturesDir, `/slug-docs/${slug}.md`)));

const getMock = getAPIv1Mock()
Expand Down
10 changes: 5 additions & 5 deletions __tests__/commands/changelogs/single.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fs from 'node:fs';
import path from 'node:path';

import chalk from 'chalk';
import frontMatter from 'gray-matter';
import grayMatter from 'gray-matter';
import nock from 'nock';
import { describe, beforeAll, afterAll, beforeEach, it, expect } from 'vitest';

Expand Down Expand Up @@ -46,7 +46,7 @@ describe('rdme changelogs (single)', () => {
it('should create new changelog', async () => {
const slug = 'new-doc';
const id = '1234';
const doc = frontMatter(fs.readFileSync(path.join(fullFixturesDir, `/new-docs/${slug}.md`)));
const doc = grayMatter(fs.readFileSync(path.join(fullFixturesDir, `/new-docs/${slug}.md`)));
const hash = hashFileContents(fs.readFileSync(path.join(fullFixturesDir, `/new-docs/${slug}.md`)));

const getMock = getAPIv1Mock()
Expand Down Expand Up @@ -74,7 +74,7 @@ describe('rdme changelogs (single)', () => {

it('should return creation info for dry run', async () => {
const slug = 'new-doc';
const doc = frontMatter(fs.readFileSync(path.join(fullFixturesDir, `/new-docs/${slug}.md`)));
const doc = grayMatter(fs.readFileSync(path.join(fullFixturesDir, `/new-docs/${slug}.md`)));

const getMock = getAPIv1Mock()
.get(`/api/v1/changelogs/${slug}`)
Expand Down Expand Up @@ -132,7 +132,7 @@ describe('rdme changelogs (single)', () => {
it('should use provided slug', async () => {
const slug = 'new-doc-slug';
const id = '1234';
const doc = frontMatter(fs.readFileSync(path.join(fullFixturesDir, `/slug-docs/${slug}.md`)));
const doc = grayMatter(fs.readFileSync(path.join(fullFixturesDir, `/slug-docs/${slug}.md`)));
const hash = hashFileContents(fs.readFileSync(path.join(fullFixturesDir, `/slug-docs/${slug}.md`)));

const getMock = getAPIv1Mock()
Expand Down Expand Up @@ -166,7 +166,7 @@ describe('rdme changelogs (single)', () => {
const fileContents = fs.readFileSync(path.join(fullFixturesDir, '/existing-docs/simple-doc.md'));
simpleDoc = {
slug: 'simple-doc',
doc: frontMatter(fileContents),
doc: grayMatter(fileContents),
hash: hashFileContents(fileContents),
};
});
Expand Down

0 comments on commit 3bb8b15

Please sign in to comment.