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

Shafin/dapi 549/chore docusaurus react version update test workflow #33

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/actions/setup_node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Sets up Node.js
runs:
using: composite
steps:
- name: Use Node.js 16.x
- name: Use Node.js 18.x
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8
with:
node-version: 16.x
node-version: 18.x
22 changes: 5 additions & 17 deletions docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,64 +51,52 @@ Our Documentation is divided in several sections:
</RenderOfficialContents>

<RenderOfficialContents>
<p>
Have a look at the <a href='/docs/category/core-concepts'>Core concepts</a> pages and take your
time to read through it. These concepts will help you get familiar with our WebSocket server api
and how to use it more efficiently. They are not related to any of our frameworks or libraries.
</p>
</RenderOfficialContents>

<RenderOfficialContents>
<p>
When you read through the <a href='/docs/category/core-concepts'>Core concepts</a> page, you can
start choosing your implementation approach based on the language, framework or library you want
to use in your application.
</p>
</RenderOfficialContents>

<h4>Code Examples</h4>

<p>
If you want to know how you can implement our API within your code, then we suggest to have a look
at our <a href='/docs/category/code-examples'>Code examples</a>. These code examples come in
`CodeSandboxes`. This allows you to easily fork the code examples and experiment with them for
personal use. For now we only have JavaScript code examples, but, we plan to add more examples
that are created with different languages, frameworks and libraries in the near future.
</p>
If you want to know how you can implement our API within your code, then we suggest to have a look
at our <a href='/docs/category/code-examples'>Code examples</a>. These code examples come in
`CodeSandboxes`. This allows you to easily fork the code examples and experiment with them for
personal use. For now we only have JavaScript code examples, but, we plan to add more examples
that are created with different languages, frameworks and libraries in the near future.

<RenderOfficialContents>
<h4>Languages</h4>
</RenderOfficialContents>

<RenderOfficialContents>
<p>
When using our code examples, we also suggest to have a look at our{' '}
<a href='/docs/category/languages'>Languages</a> section. Here, we describe in detail how you
can setup your personal project properly to make use of our API. This will surely come helpful
when you try to integrate some of our code examples in your own project.
</p>
</RenderOfficialContents>

<RenderOfficialContents>
<h4>Guides</h4>
</RenderOfficialContents>

<RenderOfficialContents>
<p>
If you want to know for example how you can `monetize your application` or how to create a
`secure way for users to log in` to your application, then we provide a handful of{' '}
<a href='/docs/category/guides'>Guides</a> that can assist you with that.
</p>
</RenderOfficialContents>

<RenderOfficialContents>
<h4>Setting up a Deriv application</h4>
</RenderOfficialContents>

<RenderOfficialContents>
<p>
If you want to know more about the essentials that are needed to setup your own application,
then have a look at the{' '}
<a href='/docs/setting-up-a-deriv-application'>Setting up a Deriv application</a> section.
</p>
</RenderOfficialContents>
7 changes: 3 additions & 4 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const lightCodeTheme = require('prism-react-renderer/themes/nightOwlLight');
const darkCodeTheme = require('prism-react-renderer/themes/vsDark');
const prismReactRenderer = require('prism-react-renderer');

/** @type {import('@docusaurus/types').Config} */
const config = {
Expand Down Expand Up @@ -126,8 +125,8 @@ const config = {
],
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
theme: prismReactRenderer?.themes?.nightOwlLight,
darkTheme: prismReactRenderer?.themes?.vsDark,
},
liveCodeBlock: {
/**
Expand Down
7 changes: 6 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ module.exports = {
coverageReporters: ['lcov'],
testEnvironment: 'jsdom',
transform: {
'^.+\\.(j|t)sx?$': 'ts-jest',
'^.+\\.(j|t)sx?$': [
'ts-jest',
{
diagnostics: false,
},
],
'^.+\\.mjs$': 'babel-jest',
},
transformIgnorePatterns: ['node_modules/(?!(@docusaurus|swiper|ssr-window|dom7)|@theme)'],
Expand Down
23 changes: 23 additions & 0 deletions jest.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,26 @@ window.ResizeObserver =
observe: jest.fn(),
unobserve: jest.fn(),
}));

Object.defineProperty(window, 'matchMedia', {
writable: true,
value: jest.fn().mockImplementation((query) => ({
matches: false,
media: query,
onchange: null,
addEventListener: jest.fn(),
removeEventListener: jest.fn(),
dispatchEvent: jest.fn(),
})),
});

Object.defineProperty(window, 'scrollTo', { value: jest.fn(), writable: true });

const originalConsoleWarn = console.warn;
console.warn = (...args) => {
// Filter out the specific warning about trackjs as we are not setting environment variables in the test environment
if (!args[0].includes('trackjs is not installed due to a missing token')) {
// Forward all other warnings to the original console.warn
originalConsoleWarn(...args);
}
};
Loading
Loading