You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					18 lines
				
				264 B
			
		
		
			
		
	
	
					18 lines
				
				264 B
			| 
								 
											3 years ago
										 
									 | 
							
								'use strict'
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								const t = require('tap')
							 | 
						||
| 
								 | 
							
								const build = require('..')
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								const stringify = build({
							 | 
						||
| 
								 | 
							
								  $defs: {
							 | 
						||
| 
								 | 
							
								    type: 'foooo"bar'
							 | 
						||
| 
								 | 
							
								  },
							 | 
						||
| 
								 | 
							
								  patternProperties: {
							 | 
						||
| 
								 | 
							
								    x: { $ref: '#/$defs' }
							 | 
						||
| 
								 | 
							
								  }
							 | 
						||
| 
								 | 
							
								})
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								t.throws(() => {
							 | 
						||
| 
								 | 
							
								  stringify({ x: 0 })
							 | 
						||
| 
								 | 
							
								}, 'Cannot coerce 0 to "foo"bar"')
							 |