Skip to content

Commit

Permalink
🐛 Fix exercise test with label
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanc1 committed May 28, 2023
1 parent 2bc07cf commit dd88590
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/myst-ext-exercise/tests/exercise.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ import { exerciseDirective } from 'myst-ext-exercise';

describe('exercise directive', () => {
it('exercise directive parses', async () => {
const content = '```{exercise} Exercise Title\nExercise content\n```';
const content = '```{exercise} Exercise Title\n:label: ex-1\nExercise content\n```';
const expected = {
type: 'root',
children: [
{
type: 'mystDirective',
name: 'exercise',
options: {
label: 'ex-1',
},
args: 'Exercise Title',
value: 'Exercise content',
position: {
Expand All @@ -18,14 +21,16 @@ describe('exercise directive', () => {
column: 0,
},
end: {
line: 3,
line: 4,
column: 0,
},
},
children: [
{
type: 'exercise',
enumerated: true,
identifier: 'ex-1',
label: 'ex-1',
children: [
{
type: 'admonitionTitle',
Expand All @@ -47,11 +52,11 @@ describe('exercise directive', () => {
position: {
end: {
column: 0,
line: 2,
line: 3,
},
start: {
column: 0,
line: 1,
line: 2,
},
},
},
Expand Down

0 comments on commit dd88590

Please sign in to comment.