summaryrefslogtreecommitdiff
path: root/packages/telemetry/test
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--packages/astro/test/events.test.js (renamed from packages/telemetry/test/session-event.test.js)78
-rw-r--r--packages/telemetry/test/config.test.js9
-rw-r--r--packages/telemetry/test/index.test.js9
3 files changed, 30 insertions, 66 deletions
diff --git a/packages/telemetry/test/session-event.test.js b/packages/astro/test/events.test.js
index 5702f5fa5..3eeef269c 100644
--- a/packages/telemetry/test/session-event.test.js
+++ b/packages/astro/test/events.test.js
@@ -18,7 +18,6 @@ describe('Session event', () => {
const [{ payload }] = events.eventCliSession(
{
cliCommand: 'dev',
- astroVersion: '0.0.0',
},
config
);
@@ -37,7 +36,6 @@ describe('Session event', () => {
const [{ payload }] = events.eventCliSession(
{
cliCommand: 'dev',
- astroVersion: '0.0.0',
},
config
);
@@ -54,7 +52,6 @@ describe('Session event', () => {
const [{ payload }] = events.eventCliSession(
{
cliCommand: 'dev',
- astroVersion: '0.0.0',
},
config
);
@@ -74,7 +71,6 @@ describe('Session event', () => {
const [{ payload }] = events.eventCliSession(
{
cliCommand: 'dev',
- astroVersion: '0.0.0',
},
config
);
@@ -88,7 +84,6 @@ describe('Session event', () => {
publicDir: 1,
markdown: {
drafts: true,
- mode: 'mdx',
shikiConfig: {
lang: 1,
theme: 2,
@@ -102,7 +97,6 @@ describe('Session event', () => {
const [{ payload }] = events.eventCliSession(
{
cliCommand: 'dev',
- astroVersion: '0.0.0',
},
config
);
@@ -110,7 +104,6 @@ describe('Session event', () => {
'publicDir',
'markdown',
'markdown.drafts',
- 'markdown.mode',
'markdown.shikiConfig',
'markdown.shikiConfig.lang',
'markdown.shikiConfig.theme',
@@ -121,22 +114,6 @@ describe('Session event', () => {
]);
});
- it('mode', () => {
- const config = {
- markdown: {
- mode: 'mdx',
- },
- };
- const [{ payload }] = events.eventCliSession(
- {
- cliCommand: 'dev',
- astroVersion: '0.0.0',
- },
- config
- );
- expect(payload.config.markdown.mode).to.equal('mdx');
- });
-
it('syntaxHighlight', () => {
const config = {
markdown: {
@@ -146,7 +123,6 @@ describe('Session event', () => {
const [{ payload }] = events.eventCliSession(
{
cliCommand: 'dev',
- astroVersion: '0.0.0',
},
config
);
@@ -172,7 +148,6 @@ describe('Session event', () => {
const [{ payload }] = events.eventCliSession(
{
cliCommand: 'dev',
- astroVersion: '0.0.0',
},
config
);
@@ -203,7 +178,6 @@ describe('Session event', () => {
const [{ payload }] = events.eventCliSession(
{
cliCommand: 'dev',
- astroVersion: '0.0.0',
},
config
);
@@ -231,7 +205,6 @@ describe('Session event', () => {
const [{ payload }] = events.eventCliSession(
{
cliCommand: 'dev',
- astroVersion: '0.0.0',
},
config
);
@@ -262,7 +235,6 @@ describe('Session event', () => {
const [{ payload }] = events.eventCliSession(
{
cliCommand: 'dev',
- astroVersion: '0.0.0',
},
config
);
@@ -293,7 +265,6 @@ describe('Session event', () => {
const [{ payload }] = events.eventCliSession(
{
cliCommand: 'dev',
- astroVersion: '0.0.0',
},
config
);
@@ -322,7 +293,6 @@ describe('Session event', () => {
const [{ payload }] = events.eventCliSession(
{
cliCommand: 'dev',
- astroVersion: '0.0.0',
},
config
);
@@ -348,7 +318,6 @@ describe('Session event', () => {
const [{ payload }] = events.eventCliSession(
{
cliCommand: 'dev',
- astroVersion: '0.0.0',
},
config
);
@@ -373,7 +342,6 @@ describe('Session event', () => {
const [{ payload }] = events.eventCliSession(
{
cliCommand: 'dev',
- astroVersion: '0.0.0',
},
config
);
@@ -398,7 +366,6 @@ describe('Session event', () => {
const [{ payload }] = events.eventCliSession(
{
cliCommand: 'dev',
- astroVersion: '0.0.0',
},
config
);
@@ -411,38 +378,18 @@ describe('Session event', () => {
});
});
- describe('config.integrations + optionalIntegrations', () => {
- it('optional/conditional integrations', () => {
- const config = {
- srcDir: 1,
- integrations: [null, undefined, { name: 'example-integration' }],
- };
- const [{ payload }] = events.eventCliSession(
- {
- cliCommand: 'dev',
- astroVersion: '0.0.0',
- },
- config
- );
- expect(payload.config.integrations).deep.equal(['example-integration']);
- expect(payload.optionalIntegrations).to.equal(2);
- });
-
- it('falsy integrations', () => {
- const config = {
- srcDir: 1,
- integrations: [null, undefined, false],
- };
- const [{ payload }] = events.eventCliSession(
- {
- cliCommand: 'dev',
- astroVersion: '0.0.0',
- },
- config
- );
- expect(payload.config.integrations.length).to.equal(0);
- expect(payload.optionalIntegrations).to.equal(3);
- });
+ it('falsy integrations', () => {
+ const config = {
+ srcDir: 1,
+ integrations: [null, undefined, false],
+ };
+ const [{ payload }] = events.eventCliSession(
+ {
+ cliCommand: 'dev',
+ },
+ config
+ );
+ expect(payload.config.integrations.length).to.equal(0);
});
describe('flags', () => {
@@ -461,7 +408,6 @@ describe('Session event', () => {
const [{ payload }] = events.eventCliSession(
{
cliCommand: 'dev',
- astroVersion: '0.0.0',
},
config,
flags
diff --git a/packages/telemetry/test/config.test.js b/packages/telemetry/test/config.test.js
new file mode 100644
index 000000000..97408ec0d
--- /dev/null
+++ b/packages/telemetry/test/config.test.js
@@ -0,0 +1,9 @@
+import { expect } from 'chai';
+import {GlobalConfig} from '../dist/config.js';
+
+describe('GlobalConfig', () => {
+ it('initializes when expected arguments are given', () => {
+ const config = new GlobalConfig({ name: 'TEST_NAME' });
+ expect(config).to.be.instanceOf(GlobalConfig);
+ });
+});
diff --git a/packages/telemetry/test/index.test.js b/packages/telemetry/test/index.test.js
new file mode 100644
index 000000000..208522136
--- /dev/null
+++ b/packages/telemetry/test/index.test.js
@@ -0,0 +1,9 @@
+import { expect } from 'chai';
+import {AstroTelemetry} from '../dist/index.js';
+
+describe('AstroTelemetry', () => {
+ it('initializes when expected arguments are given', () => {
+ const telemetry = new AstroTelemetry({ version: '0.0.0-test.1' });
+ expect(telemetry).to.be.instanceOf(AstroTelemetry);
+ });
+});