mirror of
				https://github.com/mermaid-js/mermaid.git
				synced 2025-11-03 20:34:20 +01:00 
			
		
		
		
	Merge branch 'develop' into bug/1078_handling_of_arrowMarkerAbsolute
This commit is contained in:
		
							
								
								
									
										50
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,50 @@
 | 
			
		||||
name: Build
 | 
			
		||||
 | 
			
		||||
on: [push, pull_request]
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  build:
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    strategy:
 | 
			
		||||
      matrix:
 | 
			
		||||
        node-version: [10.x, 12.x]
 | 
			
		||||
    steps:
 | 
			
		||||
    - uses: actions/checkout@v1
 | 
			
		||||
 | 
			
		||||
    - name: Setup Node.js ${{ matrix.node-version }}
 | 
			
		||||
      uses: actions/setup-node@v1
 | 
			
		||||
      with:
 | 
			
		||||
        node-version: ${{ matrix.node-version }}
 | 
			
		||||
 | 
			
		||||
    - name: Install Yarn
 | 
			
		||||
      run: npm i yarn --global
 | 
			
		||||
 | 
			
		||||
    - name: Cache Node Modules
 | 
			
		||||
      uses: actions/cache@v1
 | 
			
		||||
      with:
 | 
			
		||||
        path: .cache
 | 
			
		||||
        key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
 | 
			
		||||
 | 
			
		||||
    - name: Install Packages
 | 
			
		||||
      run: |
 | 
			
		||||
        yarn config set cache-folder $GITHUB_WORKSPACE/.cache/yarn
 | 
			
		||||
        yarn install --frozen-lockfile
 | 
			
		||||
      env:
 | 
			
		||||
        CYPRESS_CACHE_FOLDER: ../../.cache/Cypress
 | 
			
		||||
 | 
			
		||||
    - name: Run Build
 | 
			
		||||
      run: yarn build
 | 
			
		||||
 | 
			
		||||
    - name: Run Unit Tests
 | 
			
		||||
      run: |
 | 
			
		||||
        yarn test --coverage
 | 
			
		||||
        cat ./coverage/lcov.info | ./node_modules/.bin/coveralls
 | 
			
		||||
      env:
 | 
			
		||||
        COVERALLS_SERVICE_NAME: ${{ secrets.COVERALLS_SERVICE_NAME }}
 | 
			
		||||
        COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
 | 
			
		||||
 | 
			
		||||
    - name: Run E2E Tests
 | 
			
		||||
      run: yarn e2e
 | 
			
		||||
      env:
 | 
			
		||||
        PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
 | 
			
		||||
        CYPRESS_CACHE_FOLDER: .cache/Cypress
 | 
			
		||||
@@ -123,6 +123,28 @@ graph LR
 | 
			
		||||
    id1{{This is the text in the box}}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### Parallelogram
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
graph TD
 | 
			
		||||
    id1[/This is the text in the box/]
 | 
			
		||||
```
 | 
			
		||||
```mermaid
 | 
			
		||||
graph TD
 | 
			
		||||
    id1[/This is the text in the box/]
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### Parallelogram alt
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
graph TD
 | 
			
		||||
    id1[\This is the text in the box\]
 | 
			
		||||
```
 | 
			
		||||
```mermaid
 | 
			
		||||
graph TD
 | 
			
		||||
    id1[\This is the text in the box\]
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### Trapezoid
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								package.json
									
									
									
									
									
								
							@@ -24,7 +24,7 @@
 | 
			
		||||
    "e2e": "start-server-and-test dev http://localhost:9000/ cypress",
 | 
			
		||||
    "e2e-upd": "yarn lint && jest e2e -u --config e2e/jest.config.js",
 | 
			
		||||
    "dev": "webpack-dev-server --config webpack.config.e2e.js",
 | 
			
		||||
    "test": "yarn lint && jest src",
 | 
			
		||||
    "test": "yarn lint && jest src/.*",
 | 
			
		||||
    "test:watch": "jest --watch src",
 | 
			
		||||
    "prepublishOnly": "yarn build && yarn release && yarn test && yarn e2e",
 | 
			
		||||
    "prepush": "yarn test"
 | 
			
		||||
@@ -77,10 +77,10 @@
 | 
			
		||||
    "cypress": "3.4.0",
 | 
			
		||||
    "husky": "^1.2.1",
 | 
			
		||||
    "identity-obj-proxy": "^3.0.0",
 | 
			
		||||
    "jest": "^23.6.0",
 | 
			
		||||
    "jest-environment-puppeteer": "^4.2.0",
 | 
			
		||||
    "jest-image-snapshot": "^2.8.2",
 | 
			
		||||
    "jest-puppeteer": "^4.2.0",
 | 
			
		||||
    "jest": "^24.9.0",
 | 
			
		||||
    "jest-environment-puppeteer": "^4.3.0",
 | 
			
		||||
    "jest-image-snapshot": "^2.11.1",
 | 
			
		||||
    "jest-puppeteer": "^4.3.0",
 | 
			
		||||
    "jison": "^0.4.18",
 | 
			
		||||
    "moment": "^2.23.0",
 | 
			
		||||
    "node-sass": "^4.12.0",
 | 
			
		||||
 
 | 
			
		||||
@@ -168,7 +168,7 @@ describe('[Singlenodes] when parsing', () => {
 | 
			
		||||
    const edges = flow.parser.yy.getEdges();
 | 
			
		||||
 | 
			
		||||
    expect(edges.length).toBe(0);
 | 
			
		||||
    expect(vert['mermaid-dom-id-1'].text).toBe('1');
 | 
			
		||||
    expect(vert['1'].text).toBe('1');
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('should handle a single node with a single digit in a subgraph', function() {
 | 
			
		||||
@@ -180,7 +180,7 @@ describe('[Singlenodes] when parsing', () => {
 | 
			
		||||
    const edges = flow.parser.yy.getEdges();
 | 
			
		||||
 | 
			
		||||
    expect(edges.length).toBe(0);
 | 
			
		||||
    expect(vert['mermaid-dom-id-1'].text).toBe('1');
 | 
			
		||||
    expect(vert['1'].text).toBe('1');
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('should handle a single node with alphanumerics starting on a num', function() {
 | 
			
		||||
@@ -191,7 +191,7 @@ describe('[Singlenodes] when parsing', () => {
 | 
			
		||||
    const edges = flow.parser.yy.getEdges();
 | 
			
		||||
 | 
			
		||||
    expect(edges.length).toBe(0);
 | 
			
		||||
    expect(vert['mermaid-dom-id-1id'].styles.length).toBe(0);
 | 
			
		||||
    expect(vert['1id'].styles.length).toBe(0);
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('should handle a single node with alphanumerics containing a minus sign', function() {
 | 
			
		||||
 
 | 
			
		||||
@@ -83,7 +83,7 @@ describe('when parsing subgraphs', function() {
 | 
			
		||||
    const subgraph = subgraphs[0];
 | 
			
		||||
    expect(subgraph.nodes.length).toBe(1);
 | 
			
		||||
    expect(subgraph.nodes[0]).toBe('A');
 | 
			
		||||
    expect(subgraph.id).toBe('mermaid-dom-id-1test');
 | 
			
		||||
    expect(subgraph.id).toBe('1test');
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('should handle subgraphs1', function() {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user