Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pref: optimize test #341

Merged
merged 20 commits into from
Aug 9, 2024
Prev Previous commit
Next Next commit
ci: patch windows
  • Loading branch information
zyyv committed Aug 2, 2024
commit 7eefcb4a1834781a0cb0b8519035cd783fb67c7b
5 changes: 1 addition & 4 deletions test/docs/docs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
const docsPath = path.resolve(__dirname, '../../docs/src/index.md');
const DOCS = fs.readFileSync(docsPath, 'utf-8');

console.log('DOCS', DOCS);
console.log('regex', /^```js$\n(^[^`].+$\n)+/gm);

const snippets = DOCS.match(/^```js$\n(^[^`].+$\n)+/gm).map((s) =>
const snippets = DOCS.match(/^```js$[\r\n](^[^`].+$[\r\n])+/gm).map((s) =>
s.split('\n').slice(1).join('\n')
);

Expand All @@ -30,7 +27,7 @@
expect(() => {
const chroma = chroma_;
eval(code);
}).not.toThrow();

Check failure on line 30 in test/docs/docs.test.js

View workflow job for this annotation

GitHub Actions / test (lts/*, windows-latest)

test/docs/docs.test.js > Tests all snippets in the documentation > run code snippet 0

AssertionError: expected [Function] to not throw an error but 'SyntaxError: Unexpected end of input' was thrown - Expected: undefined + Received: "SyntaxError: Unexpected end of input" ❯ test/docs/docs.test.js:30:20

Check failure on line 30 in test/docs/docs.test.js

View workflow job for this annotation

GitHub Actions / test (lts/*, windows-latest)

test/docs/docs.test.js > Tests all snippets in the documentation > run code snippet 1

AssertionError: expected [Function] to not throw an error but 'SyntaxError: Unexpected end of input' was thrown - Expected: undefined + Received: "SyntaxError: Unexpected end of input" ❯ test/docs/docs.test.js:30:20

Check failure on line 30 in test/docs/docs.test.js

View workflow job for this annotation

GitHub Actions / test (lts/*, windows-latest)

test/docs/docs.test.js > Tests all snippets in the documentation > run code snippet 2

AssertionError: expected [Function] to not throw an error but 'SyntaxError: Unexpected end of input' was thrown - Expected: undefined + Received: "SyntaxError: Unexpected end of input" ❯ test/docs/docs.test.js:30:20

Check failure on line 30 in test/docs/docs.test.js

View workflow job for this annotation

GitHub Actions / test (lts/*, windows-latest)

test/docs/docs.test.js > Tests all snippets in the documentation > run code snippet 3

AssertionError: expected [Function] to not throw an error but 'SyntaxError: Unexpected end of input' was thrown - Expected: undefined + Received: "SyntaxError: Unexpected end of input" ❯ test/docs/docs.test.js:30:20

Check failure on line 30 in test/docs/docs.test.js

View workflow job for this annotation

GitHub Actions / test (lts/*, windows-latest)

test/docs/docs.test.js > Tests all snippets in the documentation > run code snippet 4

AssertionError: expected [Function] to not throw an error but 'SyntaxError: Unexpected end of input' was thrown - Expected: undefined + Received: "SyntaxError: Unexpected end of input" ❯ test/docs/docs.test.js:30:20

Check failure on line 30 in test/docs/docs.test.js

View workflow job for this annotation

GitHub Actions / test (lts/*, windows-latest)

test/docs/docs.test.js > Tests all snippets in the documentation > run code snippet 5

AssertionError: expected [Function] to not throw an error but 'SyntaxError: Unexpected end of input' was thrown - Expected: undefined + Received: "SyntaxError: Unexpected end of input" ❯ test/docs/docs.test.js:30:20

Check failure on line 30 in test/docs/docs.test.js

View workflow job for this annotation

GitHub Actions / test (lts/*, windows-latest)

test/docs/docs.test.js > Tests all snippets in the documentation > run code snippet 6

AssertionError: expected [Function] to not throw an error but 'SyntaxError: Unexpected end of input' was thrown - Expected: undefined + Received: "SyntaxError: Unexpected end of input" ❯ test/docs/docs.test.js:30:20

Check failure on line 30 in test/docs/docs.test.js

View workflow job for this annotation

GitHub Actions / test (lts/*, windows-latest)

test/docs/docs.test.js > Tests all snippets in the documentation > run code snippet 7

AssertionError: expected [Function] to not throw an error but 'SyntaxError: Unexpected end of input' was thrown - Expected: undefined + Received: "SyntaxError: Unexpected end of input" ❯ test/docs/docs.test.js:30:20

Check failure on line 30 in test/docs/docs.test.js

View workflow job for this annotation

GitHub Actions / test (lts/*, windows-latest)

test/docs/docs.test.js > Tests all snippets in the documentation > run code snippet 8

AssertionError: expected [Function] to not throw an error but 'SyntaxError: Unexpected end of input' was thrown - Expected: undefined + Received: "SyntaxError: Unexpected end of input" ❯ test/docs/docs.test.js:30:20

Check failure on line 30 in test/docs/docs.test.js

View workflow job for this annotation

GitHub Actions / test (lts/*, windows-latest)

test/docs/docs.test.js > Tests all snippets in the documentation > run code snippet 9

AssertionError: expected [Function] to not throw an error but 'SyntaxError: Unexpected end of input' was thrown - Expected: undefined + Received: "SyntaxError: Unexpected end of input" ❯ test/docs/docs.test.js:30:20
});
});
});