chore: delete tests

This commit is contained in:
Nate Moore 2023-09-12 16:21:23 -05:00
parent 878bb78afe
commit 7420004657
7 changed files with 0 additions and 150 deletions

View file

@ -1 +0,0 @@
{}

View file

@ -1,4 +0,0 @@
{
"name": "@test/create-astro-not-empty",
"private": true
}

View file

@ -1 +0,0 @@
{}

View file

@ -1,72 +0,0 @@
import { expect } from 'chai';
import { install } from '../dist/index.js';
import { setup } from './utils.js';
describe('install', () => {
const fixture = setup();
it('--yes', async () => {
const context = {
cwd: '',
yes: true,
pkgManager: 'npm',
dryRun: true,
prompt: () => ({ deps: true }),
};
await install(context);
expect(fixture.hasMessage('Skipping dependency installation')).to.be.true;
});
it('prompt yes', async () => {
const context = {
cwd: '',
pkgManager: 'npm',
dryRun: true,
prompt: () => ({ deps: true }),
install: undefined,
};
await install(context);
expect(fixture.hasMessage('Skipping dependency installation')).to.be.true;
expect(context.install).to.eq(true);
});
it('prompt no', async () => {
const context = {
cwd: '',
pkgManager: 'npm',
dryRun: true,
prompt: () => ({ deps: false }),
install: undefined,
};
await install(context);
expect(fixture.hasMessage('Skipping dependency installation')).to.be.true;
expect(context.install).to.eq(false);
});
it('--install', async () => {
const context = {
cwd: '',
install: true,
pkgManager: 'npm',
dryRun: true,
prompt: () => ({ deps: false }),
};
await install(context);
expect(fixture.hasMessage('Skipping dependency installation')).to.be.true;
expect(context.install).to.eq(true);
});
it('--no-install', async () => {
const context = {
cwd: '',
install: false,
pkgManager: 'npm',
dryRun: true,
prompt: () => ({ deps: false }),
};
await install(context);
expect(fixture.hasMessage('Skipping dependency installation')).to.be.true;
expect(context.install).to.eq(false);
});
});

View file

@ -1,31 +0,0 @@
import { setStdout } from '../dist/index.js';
import stripAnsi from 'strip-ansi';
export function setup() {
const ctx = { messages: [] };
before(() => {
setStdout(
Object.assign({}, process.stdout, {
write(buf) {
ctx.messages.push(stripAnsi(String(buf)).trim());
return true;
},
})
);
});
beforeEach(() => {
ctx.messages = [];
});
return {
messages() {
return ctx.messages;
},
length() {
return ctx.messages.length;
},
hasMessage(content) {
return !!ctx.messages.find((msg) => msg.includes(content));
},
};
}

View file

@ -1,41 +0,0 @@
import { expect } from 'chai';
import { verify } from '../dist/index.js';
import { setup } from './utils.js';
describe('verify', () => {
const fixture = setup();
const exit = (code) => {
throw code;
};
it('basics', async () => {
const context = { template: 'basics', exit };
await verify(context);
expect(fixture.messages().length).to.equal(0, 'Did not expect `verify` to log any messages');
});
it('missing', async () => {
const context = { template: 'missing', exit };
let err = null;
try {
await verify(context);
} catch (e) {
err = e;
}
expect(err).to.eq(1);
expect(fixture.hasMessage('Template missing does not exist!'));
});
it('starlight', async () => {
const context = { template: 'starlight', exit };
await verify(context);
expect(fixture.messages().length).to.equal(0, 'Did not expect `verify` to log any messages');
});
it('starlight/tailwind', async () => {
const context = { template: 'starlight/tailwind', exit };
await verify(context);
expect(fixture.messages().length).to.equal(0, 'Did not expect `verify` to log any messages');
});
});