<commit_before>﻿$CommandName = $MyInvocation.MyCommand.Name.Replace(".Tests.ps1", "")
Write-Host -Object "Running $PSCommandpath" -ForegroundColor Cyan
. "$PSScriptRoot\constants.ps1"

Describe "$commandname Integration Tests" -Tags "IntegrationTests" {
	BeforeAll {
		$dbname = "dbatoolsci_exportdacpac"
		$server = Connect-DbaInstance -SqlInstance $script:instance1
		$null = $server.Query("Create Database [$dbname]")
		$db = Get-DbaDatabase -SqlInstance $server -Database $dbname
		$null = $db.Query("CREATE TABLE dbo.example (id int); 
			INSERT dbo.example
			SELECT top 100 1 
			FROM sys.objects")
		
	}
	AfterAll {
		Remove-DbaDatabase -SqlInstance $script:instance1 -Database $dbname -Confirm:$false
		if ($global:wtf) {
			Remove-Item -Confirm:$false -Path $global:wtf -ErrorAction SilentlyContinue
		}
		Remove-Variable -Name wtf -Scope Global
	}
	
	
	Context "Testing the command" {
		$results = Export-DbaDacpac -SqlInstance $script:instance1 -Database $dbname
		It "exports a dacpac" {
			Test-Path -Path $results.Path | Should Be $true
		}
		# Something is up with scoping
		$global:wtf = $results.Path
	}
}<commit_msg>fix test lol<commit_after>﻿$CommandName = $MyInvocation.MyCommand.Name.Replace(".Tests.ps1", "")
Write-Host -Object "Running $PSCommandpath" -ForegroundColor Cyan
. "$PSScriptRoot\constants.ps1"

Describe "$commandname Integration Tests" -Tags "IntegrationTests" {
	BeforeAll {
		$dbname = "dbatoolsci_exportdacpac"
		$server = Connect-DbaInstance -SqlInstance $script:instance1
		$null = $server.Query("Create Database [$dbname]")
		$db = Get-DbaDatabase -SqlInstance $server -Database $dbname
		$null = $db.Query("CREATE TABLE dbo.example (id int); 
			INSERT dbo.example
			SELECT top 100 1 
			FROM sys.objects")
		
	}
	AfterAll {
		Remove-DbaDatabase -SqlInstance $script:instance1 -Database $dbname -Confirm:$false
		if ($global:wtf) {
			Remove-Item -Confirm:$false -Path $global:wtf -ErrorAction SilentlyContinue
		}
			Remove-Variable -Name wtf -Scope Global -ErrorAction SilentlyContinue
	}
	
	
	Context "Testing the command" {
		$results = Export-DbaDacpac -SqlInstance $script:instance1 -Database $dbname
		It "exports a dacpac" {
			Test-Path -Path $results.Path | Should Be $true
		}
		# Something is up with scoping
		$global:wtf = $results.Path
	}
}
{'fraction_non_alphanumeric': 0.12130434782608696, 'fraction_numerical': 0.00782608695652174, 'mean_word_length': 4.2654462242562925, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1763560', 'n_tokens_mistral': 843, 'n_tokens_neox': 755, 'n_words': 190}